3

I want to execute a R script in R Studio using batch file. I know how to execute R script using batch file in R though. When I try to execute using the following:

"C:\Program Files\RStudio\bin\rstudio.exe" CMD BATCH --vanilla --slave "C:\Users\kpappala\Desktop\R schedule\task.R" 

It just opens R studio but doesn't execute. Is there a way?
Thanks!

1

2 Answers 2

2

Rstudio is an IDE for R. It isn't R though. It doesn't really even make sense to run it in batch through rstudio.

If you're just saying you want to run a file from within Rstudio that's different and you can just source it or run it in batch via system using a call to R CMD BATCH.

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

Comments

0

This question was answered here: batch execute R script.

In short and as Dason said, you Rstudio is just a shell, and doesn't actually run the code. For that use R. Try this instead:

PATH C:\Program Files\R\R-3.1.0\bin;%path% Rscript "C:\Users\kpappala\Desktop\R schedule\task.R"

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.