Lenue001
Lenue001

Reputation: 17

Use vscode to run r programs with R 4.0.5 installed

I have vscode and the R extension installed as well as R 4.0.5 on my computer ,but when I run the code in vscode i get this error message

'Rscript' is not recognized as an internal or external command, operable program or batch file.

what do I need to do so I can run R code in vscode.

Upvotes: 0

Views: 870

Answers (1)

van Nijnatten
van Nijnatten

Reputation: 404

You probably need to add the directory containing R and RScript to your PATH variable. In Linux/MacOS you can add the following line to your ~/.bashrc file:

# Change /usr/local/bin/ to where R is located
PATH=“/usr/local/bin/:$PATH"

In Windows follow the steps in the article: https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14) The installation directory in Windows is probably something like 'C:/Program Files/R’.

Upvotes: 1

Related Questions