On 12/08/2011 2:03 PM, RobertJK wrote:
Any way to run an R function every 5 minutes from the R terminal? Searched
around but couldn't find any answers. Thanks!!

Yes, but not in the background:

repeat {
  f()
  Sys.sleep(300)
}

If you want it run in the background, get your OS to run R to do it. (It's possible the tcltk package will give you access to some tcl way to set a background process; I don't know. Similarly, you could call out to C and start up another thread, etc., but R itself is single-threaded.)

Duncan Murdoch

______________________________________________
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.

Reply via email to