Skip to content
Back to formatted view

Raw Message

Message-ID: <alpine.LFD.2.00.1012070741520.10594@gannet.stats.ox.ac.uk>
Date: 2010-12-07T07:53:22Z
From: Brian Ripley
Subject: Time out for a R Function
In-Reply-To: <4cfd9630.0bb38e0a.7e4a.7dab@mx.google.com>

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 a
> timeout on a function and the r-process needes to move on to the next step?

See the help on setTimeLimit(transient = FALSE) .  Unlike other 
suggestions, that does not need you to change the code to check the 
time.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595