[R] No traceback available when using try(...)
Thomas Lumley
tlumley at u.washington.edu
Fri Mar 12 18:16:26 CET 2004
On Fri, 12 Mar 2004, Roger D. Peng wrote:
> Funny, it works for me on R-patched
>
> > f <- function(a) { return(log(a)) }
> > f("A")
> Error in log(x) : Non-numeric argument to mathematical function
> > traceback()
> 2: log(a)
> 1: f("A")
> > try(f("A"))
> Error in log(x) : Non-numeric argument to mathematical function
> > traceback()
> 2: log(a)
> 1: f("A")
>
No, it doesn't. The second traceback() call is printing the *previous*
trace information, which in this case is the same.
The bug in 1.8.1, which *is* fixed, is that you didn't get traceback
information anywhere, rather than not getting it with try()
-thomas
More information about the R-help
mailing list