I am trying to schedule a cron job via RStudio on EC2 instance.
When I use a basic script with very basic functions it works fine.
But when I want to schedule a script that contains R functions from specfic R packages, the scripts fails.
After the script is launched, I receive an email from Cron Daemon specifying something like:
Error in R_function :
could not find function R_function
Execution halted
From what I found, it seems I have to specify that I want to run the script within RStudio or that I want to "source" it.
I have the feeling the answer might be in the combination of these 3 posts below but I am not finding the solution after testing out some suggestions: