How to run a R language(.r) file using Batch file?

Viewed 61605

I want to run a R script file (.r) using batch file.

4 Answers

I struggled with the syntax with the answers below, but this worked for me in the .bat file:

C:\Windows\System32\cmd.exe /k ""path to Rscript.exe" 
"path to .R script""

Be sure to place both the path to Rscript.exe and the script in "" together and separately as above.

Related