Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute R script in R studio using batch file

Tags:

r

batch-file

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!

like image 385
Karan Pappala Avatar asked Jul 20 '26 12:07

Karan Pappala


1 Answers

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.

like image 109
Dason Avatar answered Jul 22 '26 03:07

Dason



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!