Skip to content
Prev 200064 / 398506 Next

Auto execute R script

This is on windows I am assuming? On linux, you can write a script, then 
have cron execute it, similar to below, only I think you need to replace 
Rterm with R CMD or something.

Put this in a batch file, and create a scheduled task. Make sure to put 
the "start in" or "working directory" to the same as where your R script is.

This requires that you have %R_HOME% added to your path (on Windows at 
least)

Rterm --verbose --no-restore --file=MorningStartup.r > 
morningsummary-log.txt

Replace MorningStartup.r and morningsummary-log.txt with your R script 
and a log file name of your choice.

HTH
cedrick
Jason Gasper wrote: