[R] Running R at a specific time - alternative to Sys.sleep() ?

jim holtman jholtman at gmail.com
Mon Oct 13 20:35:21 CEST 2008


Use the task scheduler in Windows and have a batch files executed.

On Mon, Oct 13, 2008 at 11:44 AM, Tony Breyal
<tony.breyal at googlemail.com> wrote:
> Dear R-Help,
>
> Is it possible to set R up to run a particular script at specific
> times of the day? trivial example: If the time is now 8:59:55am and I
> wish to run a function at 9am, I do the following:
>
>
> my.function <- function(x) {
>    p1 <- proc.time()
>    Sys.sleep(x)
>    print('Hello R-Help!')
>    proc.time() - p1
> }
> my.function (5)
>
> [1] "Hello R-Help!"
>   user  system elapsed
>      0       0       5
>
>
> What I would rather do is just put in the time at which I wish R to
> execute at.
>
> Hope that made sense, and thanks for any help in advance!
> Tony Breyal
>
> ### Windows Vista
>> sessionInfo()
> R version 2.7.2 (2008-08-25)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.
> 1252;LC_MONETARY=English_United Kingdom.
> 1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods
> base
>
> loaded via a namespace (and not attached):
> [1] RCurl_0.9-4
>
> ______________________________________________
> 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?



More information about the R-help mailing list