Is there functionality within R proper, without having to revert to the OS, allowing a function or a portion of an R script to be run at a defined time? My google searches haven't provided much other than one at the link below which relies on an OS. Thanks, Harold https://tgmstat.wordpress.com/2013/09/11/schedule-rscript-with-cron/ [[alternative HTML version deleted]]
On 26/02/2015 2:08 PM, Doran, Harold wrote:> Is there functionality within R proper, without having to revert to the OS, allowing a function or a portion of an R script to be run at a defined time? My google searches haven't provided much other than one at the link below which relies on an OS.If you want it to start 1000 seconds from now, use Sys.sleep(1000) as your first statement. You'll have a process sitting there using no CPU (but perhaps lots of virtual memory) until the sleeping is done. Using cron is better. Duncan Murdoch
I have a problem with statistics, I think this forum is not the right option, but I'm running out resolution to my problem, so I thought I expose you here so someone could help me. Realized a certain amount of tests in different groups, this assessment had different weights, and the groups were formed by the different amount of people. I thought of calculating the average to see how much each person contributed to the total amount of the assessment. What I would like to know if there is another way I use the absolute number and the average for quantifying group was better. Table Group Absolute Points Unit Average A 700 35 20 B 500 20 25 C 900 150 6 D 300 10 30 Att.. Mestre. Marcelo Alves Costa Grupo de Estudo e Pesquisa em Desenvolvimento e Aprendizagem Motora (GEPEDAM) Centro Universit?rio Filad?lfia (43) 9646-1071 2015-02-26 16:08 GMT-03:00 Doran, Harold <HDoran at air.org>:> Is there functionality within R proper, without having to revert to the > OS, allowing a function or a portion of an R script to be run at a defined > time? My google searches haven't provided much other than one at the link > below which relies on an OS. > > Thanks, > Harold > > https://tgmstat.wordpress.com/2013/09/11/schedule-rscript-with-cron/ > > [[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. >[[alternative HTML version deleted]]
Everything Duncan said, plus: A construction like this might do the job run.at <- as.POSIXct('2015-02-26 13:05') while(TRUE) { if ( trunc(Sys.time(),'min') == run.at) source('whatever-it-is.r') Sys.sleep(60) } but I wouldn't count on it to be as reliable as cron (or Windows equivalent). -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 2/26/15, 11:20 AM, "Duncan Murdoch" <murdoch.duncan at gmail.com> wrote:>On 26/02/2015 2:08 PM, Doran, Harold wrote: >> Is there functionality within R proper, without having to revert to the >>OS, allowing a function or a portion of an R script to be run at a >>defined time? My google searches haven't provided much other than one at >>the link below which relies on an OS. > >If you want it to start 1000 seconds from now, use Sys.sleep(1000) as >your first statement. You'll have a process sitting there using no CPU >(but perhaps lots of virtual memory) until the sleeping is done. Using >cron is better. > >Duncan Murdoch > >______________________________________________ >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.
> On 26 Feb 2015, at 20:20 , Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 26/02/2015 2:08 PM, Doran, Harold wrote: >> Is there functionality within R proper, without having to revert to the OS, allowing a function or a portion of an R script to be run at a defined time? My google searches haven't provided much other than one at the link below which relies on an OS. > > If you want it to start 1000 seconds from now, use Sys.sleep(1000) as your first statement. You'll have a process sitting there using no CPU (but perhaps lots of virtual memory) until the sleeping is done. Using cron is better. >There are also some asynchronous possibilities using tcltk: tcl("after", 10000, quote(print("boo"))) Peter D.> Duncan Murdoch > > ______________________________________________ > 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
What ***on earth does the content of your message have to do with the subject line? Get your <expletive deleted> act together if you want to ask a question of this list!!! cheers, Rolf Turner On 27/02/15 08:40, macfire wrote:> I have a problem with statistics, I think this forum is not the right > option, but I'm running out resolution to my problem, so I thought I expose > you here so someone could help me. > Realized a certain amount of tests in different groups, this assessment had > different weights, and the groups were formed by the different amount of > people. I thought of calculating the average to see how much each person > contributed to the total amount of the assessment. What I would like to > know if there is another way I use the absolute number and the average for > quantifying group was better. > Table > > Group > > Absolute Points > > Unit > > Average > > A > > 700 > > 35 > > 20 > > B > > 500 > > 20 > > 25 > > C > > 900 > > 150 > > 6 > > D > > 300 > > 10 > > 30-- Rolf Turner Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 Home phone: +64-9-480-4619