Assuming your R-script is mytest.r located in D:\mydocuments\ , you can create a batch file that includes the following command:
C:\R\R-2.10.1\bin\Rcmd.exe BATCH D:\mydocuments\mytest.r
Then add it, as a new task, to the Windows Task Scheduler, setting the launch conditions there.
You can also omit the batch file. Set C:\R\R-2.10.1\bin\Rcmd.exe in the program/script text box in the task scheduler and specify the rest of the initial command as Arguments : BATCH D:\mydocuments\mytest.r
Scheduling R Tasks Using the Windows Task Scheduler (Published February 11, 2015)
taskscheduleR: R package for scheduling R scripts using the Windows task manager (Published March 17, 2016)
EDIT
Recently, I again accepted the use of batch files because I wanted the cmd window to be minimized (I could not find another way).
In particular, I populate the Actions tab of the Windows Task Scheduler as follows:
Program/script:
cmd.exe
Add arguments (optional):
/ c start / min. D: \ mydocuments \ mytest.bat ^ & exit
The contents of mytest.bat:
C: \ R \ R-3.5.2 \ bin \ x64 \ Rscript.exe D: \ mydocuments \ mytest.r params
George Dontas May 08 '10 at 10:02 a.m. 2010-05-08 10:02
source share