Reputation: 518
I am unable to source a script from the windows command line.
Entering the following command: "C:\Program Files\RStudio\bin\rstudio.exe" CMD BATCH --vanilla --slave "E:\myfile.R"
Opens Rstudio and the script in question, but does not source. Documentation notes you may specify an output file but I just want the script to execute. Any suggestions?
Upvotes: 3
Views: 4040
Reputation: 518
Agstudy's answer is all you need but as reference to others I only used two lines:
PATH C:\Program Files\R\R-3.1.0\bin;%path%
Rscript "E:\Dir With Spaces\myfile.R"
Note the path points to R and not Rstudio. The quotes in line 2 deal with Dir With Spaces.
Upvotes: 4