Re: [R] Time out for a R Function

2010-12-13 Thread Henrik Bengtsson
) } -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 07 December 2010 13:23 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] Time out for a R Function On Tue, 7 Dec 2010, Santosh Srinivas wrote: Hello Group, I have an R-function that works fine

Re: [R] Time out for a R Function

2010-12-08 Thread Santosh Srinivas
Cc: r-help@r-project.org Subject: Re: [R] Time out for a R Function On Tue, 7 Dec 2010, Santosh Srinivas wrote: Hello Group, I have an R-function that works fine for most part but sometime runs into a long loop! (I'm lazy and short on time to debug right now so want to do something easy

Re: [R] Time out for a R Function

2010-12-07 Thread Mike Marchywka
Date: Tue, 7 Dec 2010 16:11:42 +1100 From: michael.bedw...@gmail.com To: santosh.srini...@gmail.com; r-help@r-project.org Subject: Re: [R] Time out for a R Function Below is a toy function with one way of doing it. There are bound to be better

[R] Time out for a R Function

2010-12-06 Thread Santosh Srinivas
Hello Group, I have an R-function that works fine for most part but sometime runs into a long loop! (I'm lazy and short on time to debug right now so want to do something easy) For my purpose, it is ok to make few errors is there a way I can put a timeout on a function and the r-process

Re: [R] Time out for a R Function

2010-12-06 Thread Michael Bedward
Below is a toy function with one way of doing it. There are bound to be better ways :) function(niter = 10, time.out = 3) { pretend.task - function() { Sys.sleep(0.5) } start - proc.time() for (iter in 1:niter) { pretend.task() cur - proc.time() - start if

Re: [R] Time out for a R Function

2010-12-06 Thread Henrik Bengtsson
See also R help thread 'Wait for keystroke or timeout': http://www.mail-archive.com/r-help@r-project.org/msg97742.html /H On Mon, Dec 6, 2010 at 9:11 PM, Michael Bedward michael.bedw...@gmail.com wrote: Below is a toy function with one way of doing it. There are bound to be better ways :)

Re: [R] Time out for a R Function

2010-12-06 Thread Prof Brian Ripley
On Tue, 7 Dec 2010, Santosh Srinivas wrote: Hello Group, I have an R-function that works fine for most part but sometime runs into a long loop! (I'm lazy and short on time to debug right now so want to do something easy) For my purpose, it is ok to make few errors is there a way I can put