Unable to Run R Code in VS Code

I have a simple print("Hello") R script that I want to run inside VS Code, but I keep getting the same error message every time I try. The error message is as follows:

[Done] exited with code=1 in 0.055 seconds

[Running] Rscript "c:\Users\IFEANYI\Documents\Python Scripts\VScode Projects\tempCodeRunnerFile.r"

'Rscript' is not recognized as an internal or external command,

operable program or batch file.

I have installed the R VS Code extension and language server, but all to no avail. Please, can anybody be so kind as to diagnose this problem for me? Thanks in advance of your help.

Rscript is intended to be used from the command line.

Have you tried source() instead?

No, I haven't. But there was a time I could write and run R scripts in VS Code like the R Studio IDE. But suddenly, that stopped working; and it has remained so up till now.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.