I have multiple source files in R which I want to execute daily in sequence using one cron job.
The code looks like -
Master_script.R
...
...
tryCatch({
source(abc.R)
source(pqr.R)
source(xyz.R)
}, error=function(e) {
print(e)})
...
...
In case there is an error in abc.R, an error is thrown and the rest of the Master_script.R is not executed. However, I want to execute the rest of the R files pqr.R and xyz.R incase abc.R fails.
In case there is an error in abc.R, is there a way to skip file abc.R, and continue executing the remaining source files?
FYI... I am not considering packing things up into a R package for now. Also, I don't want to create separate cron jobs.
tryCatchin those scripts or havebreaktryCatch({ source(abc.R) }, error=function(e) {print(e)}