[R] Pausing calculations for a fixed amount of time

Mikkel Grum mikkel.grum at gmail.com
Wed May 19 12:56:01 CEST 2010


Is there any way to pause R for a gvien time period, i.e. without the
need for user intervention? I've got a loop that I want to have work
as hard as it can as long as there is data coming in, but when there
is no new data, I would like it to pause before checking again.
Something like in the following construction:

Set up environment: load libraries,  establish database connections, etc.
while (time_is_less_than_x) {
     Check for new data in database
     if (newdata) {
         Analyse data (lengthy calculation)
     } else {
         pause
     }
}

I'm working on Windows Server 2003, but if there is something that
only works on Linux, that's of interest too.

I am aware of the ask option in par, pause in the package sm, and
prompt.user in Zelig, but they all require user intervention to start
again.

Mikkel



More information about the R-help mailing list