[R] running functions at fixed times

detlef.steuer@unibw-hamburg.de detlef.steuer at unibw-hamburg.de
Tue Jan 9 07:25:37 CET 2001


Hi!

I can only speak for the Linux/Unix enviroment:

Try 

while(TRUE)
{
system("sleep 60")

mydata <- read.table(...)
}

to update mydata after a 60 second break. 
An alternative is to use "cron" or "at". Both allow the specification
of exact execution times, while the "while" approach tries to imitate
a real time system. 


Have a nice day
Detlef


Detlef Steuer ** Universität der Bw ** 22043 Hamburg
Tel: (0049) (0)40/6541-2819
steuer at unibw-hamburg.de



On 09-Jan-01 Jeff Miller wrote:
> 
>    Is there an easy way to automatically run an R function at fixed
> intervals of time?
> 
>     For example, if I have a file,  mydata.txt, which is updated every
> minute or so,
>     is there an R or an S function which would execute the command
> 
>     mydata <- read.table("mydata.txt")
> 
>     each minute?  Basically I just want "mydata" to be constantly updated
> without
>     my having to bother with it.
> 
>     Thanks in advance,
> 
>         Jeff Miller
> 
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> -
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> _
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list