[R] Read a file on every 0.5 (or less) second intervall

peter dalgaard pdalgd at gmail.com
Sat Nov 7 11:22:23 CET 2015


> On 07 Nov 2015, at 04:56 , Mohammad Tanvir Ahamed via R-help <r-help at r-project.org> wrote:
> 
> Hi,
> i want to read a file on every 0.5 (or less) second. How can i set this time loop to read a file ?
> Any idea will be appreciated . Thanks .  Tanvir Ahamed 

Sys.sleep() if exact timing is not too critical. Otherwise, using the tcltk packages, you can interface to the "after" Tcl command. The generic pattern is 

boo <- function() {if (running) tcl("after", 500, boo) ; cat("boo!\n")}
running <- TRUE; boo()

-pd



>   Göteborg, Sweden     |  mashranga at yahoo.com
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list