Omid
Omid

Reputation: 33

How to use Rscript in Windows 10 Command Prompt

I want to run a R code (say a.R) from Windows Command Prompt.

I tried this in CMD:

   Rscript a.R

But gives me this error:

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

Upvotes: 0

Views: 1611

Answers (1)

Gregor Thomas
Gregor Thomas

Reputation: 146224

For anything to run on the command line, it needs to be on your system path.

The error you get makes it sound like the directory containing the Rscript executable isn't on your system path. Add it to the path and it will work.

Upvotes: 1

Related Questions