Hello,
Please I am trying to schedule a simple R script, with the below code:
rawData <- rnorm(10000)
hist(rawData,
col = "lightblue",
main = "Histogram of Random Data")
The script is called histogram.R
. I wrote a schedule for it to run every 5 minutes with the taskscheduleR
package. Here is the schedule code below:
library(taskscheduleR)
hscript <- "C:/Users/IFEANYI/Documents/RData/histogram.R"
run_script <- taskscheduler_create(
taskname = "Histogram",
rscript = hscript,
schedule = "MINUTE",
starttime = format(Sys.time() + 60, "%H:%M"),
modifier = 5
)
After setting the schedule, I got a message saying my schedule was set successfully. Nevertheless, the script doesn't run on schedule. It doesn't run at all. I kept R Studio open, hoping to see the shape of the histogram plot change every 5 minutes, but nothing is happening. Please can someone advise me on what is going on, or what I am not doing right? Thanks as always for your help.