I am having problems trying to run an R script using Rscript via crontab .
The following command works fine when run on the command line
Rscript /var/www/html/sent/sentiment/code/parse.r
But the next line inside crontab
*/5 * * * * Rscript /var/www/html/sent/sentiment/code/parse.r > /var/www/html/sent/sentiment/code/backup.log 2>&1
Will return the following error to the log
Error in library(twitteR) : there is no package called 'twitteR' Execution halted
Why is it possible that Rscript cannot find packages when working with cron? How can I do crontab 'see' my R. packages
Any advice is greatly appreciated.
source share