On Wed, Jul 1, 2009 at 8:41 PM, Michael<comtech....@gmail.com> wrote: > Hi all, > > How could I set a timer in R, so that at fixed interval, the R program > will invoke some other functions to run some tasks? >
Use timer events in the tcltk package: > z=function(){cat("Hello you!\n");tcl("after",1000,z)} > tcl("after",1000,z) now every 1000ms it will say "Hello you!". I'm not sure how to stop this without quitting R. There's probably some tcl function that clears it. Maybe. Or not. Just make sure you don't *always* reschedule another event on every event. Barry ______________________________________________ R-help@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.