[R] Hard Stop?
William Dunlap
wdunlap at tibco.com
Thu Feb 7 17:14:41 CET 2013
q()?
E.g.,
> f <- function(x) { switch(sign(x)+2, q(), stop("Oops"), NULL) ; sqrt(x) }
> tryCatch(f(2), error=function(e)"error")
[1] 1.414214
> tryCatch(f(0), error=function(e)"error")
[1] "error"
> tryCatch(f(-2), error=function(e)"error")
Save workspace image? [y/n/c]: c
> for(i in 1:3)tryCatch(f(-2), error=function(e)"error")
Save workspace image? [y/n/c]: c
>
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf
> Of ivo welch
> Sent: Wednesday, February 06, 2013 5:33 PM
> To: r-help
> Subject: [R] Hard Stop?
>
> is it possible to throw a stop() that is so hard that it will escape
> even tryCatch?
>
> /iaw
> ----
> Ivo Welch (ivo.welch at gmail.com)
>
> ______________________________________________
> 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.
More information about the R-help
mailing list