3

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?

2
  • 5
    You should use Rscript not rstudio! See my answer here for example. Commented May 26, 2014 at 14:49
  • Thanks agstudy, that got me there. R is a huge learning curve...love it though! Commented May 28, 2014 at 10:16

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.