Skip to content

R command execution at specific time from within R

3 messages · Costas Vorlow, Dirk Eddelbuettel, Greg Snow

#
Costas Vorlow <costas.vorlow <at> gmail.com> writes:
Don't do it.   Just rely on cron [if you're lucky enough to be on Linux 
or OS X]; else rely on Windows Scheduler.  

Write a simple script using RScript, schedule.  Thousands of people do the 
sample.  

Dirk
3 days later
#
If you really have to do this within R (see Dirk's reply for other
options) then the tclTaskSchedule function in the tcltk2 package is
one option.  However this can be dangerous if you are using the same
instance of R while waiting.  You might accidentally change something
that affects or is affected by the scheduled code and create a hard to
find bug.


Another is just to use a repeat loop with Sys.sleep for the delays.
This will not allow you to use that instance of R for anything else.
On Mon, Dec 23, 2013 at 8:57 AM, Costas Vorlow <costas.vorlow at gmail.com> wrote: