If you are working on a Power bi Combined with R language and want to schedule your R scripts while you are off running, sleeping or having a coffee break, online exsist a brilliant solution that works with Windows:
A scheduled task is a script with R code which is run through Rscript, You can schedule tasks :
- once
- monthly
- weekly
- daily
- Hourly
- Minute
- onlogon
- onidle
After the script has run, you can check the log which can be found at the same folder as the R script.
Some Examples to use it:
Start Library
library(taskscheduleR)
myscript <- system.file(“extdata”, “helloworld.R”, package = “taskscheduleR”)
run script once within 62 seconds
taskscheduler_create(taskname = “myfancyscript”, rscript = myscript,
schedule = “ONCE”, starttime = format(Sys.time() + 62, “%H:%M”))
run script every day at 09:10
taskscheduler_create(taskname = “myfancyscriptdaily”, rscript = myscript,
schedule = “DAILY”, starttime = “09:10″)
delete the tasks
taskscheduler_delete(taskname = “myfancyscript”)
taskscheduler_delete(taskname = “myfancyscriptdaily”)