Costas Vorlow
2013-Dec-23 15:57 UTC
[R] R command execution at specific time from within R
Hello, I am trying to write a code that executes an R command at specific time intervals. É want R to do that instead of the operating system. Any help/pointer extremely welcome. Thanks in advance, Costas [[alternative HTML version deleted]]
Dirk Eddelbuettel
2013-Dec-23 16:13 UTC
[R] R command execution at specific time from within R
Costas Vorlow <costas.vorlow <at> gmail.com> writes:> I am trying to write a code that executes an R command at specific time > intervals. > > ? want R to do that instead of the operating system. > > Any help/pointer extremely welcome.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
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:> Hello, > > I am trying to write a code that executes an R command at specific time > intervals. > > ? want R to do that instead of the operating system. > > Any help/pointer extremely welcome. > > Thanks in advance, > Costas > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com