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
Pausing calculations for a fixed amount of time
2 messages · Mikkel Grum, jim holtman
?Sys.sleep
On Wed, May 19, 2010 at 6:56 AM, Mikkel Grum <mikkel.grum at gmail.com> wrote:
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
______________________________________________ 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.
Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?