[R] Automatic traceback

From: Michael Hoffman <b3i4old02_at_sneakemail.com>
Date: Wed, 16 Jan 2008 12:03:11 +0000

I would like to have an automatic traceback printed on error. Is there a way to do this?

options(error=traceback) seems to print the previous error, not the current error. I'm guessing this is because the traceback is not set until the error handler is done running.

> options(error=traceback)
> stop("1")

Error: 1
No traceback available
> stop("2")

Error: 2
1: stop("1")
> stop("3")

Error: 3
1: stop("2")

I am using R version 2.6.0 (2007-10-03).

Michael Hoffman

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 16 Jan 2008 - 12:05:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jan 2008 - 13:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive