[R] How to a handle an error in a loop

Thomas Lumley tlumley at u.washington.edu
Mon May 8 16:48:58 CEST 2006


On Fri, 5 May 2006, Berton Gunter wrote:

> ?try
>
> as in
>
> result<- try (some R expression...)
> if (inherits(result,'try-error')) ...do something
> else ...do something else

Or tryCatch(), as described in the FAQ

 	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list