Skip to content
Prev 201740 / 398506 Next

ow to have R automatically print traceback upon errors

Hi Jim,

Thanks for your suggestion. It is working now. The earlier message " recover
called non-interactively;
occur in a R console.

Jeff

-----Original Message-----
From: jim holtman [mailto:jholtman at gmail.com] 
Sent: Monday, November 23, 2009 11:00 PM
To: Hao Cen
Cc: r-help at r-project.org
Subject: Re: [R] ow to have R automatically print traceback upon errors

I use this:

options(error=utils::recover)

and anytime an error occurs in the interactive mode, it will print out
the traceback and then allow you to explore the variables at each
level of the stack; just like putting 'browser()' in the code at the
error point.

Here is what I get in running under Windows:
Error in x() : could not find function "xyz"  <== error message

Enter a frame number, or 0 to exit

1: x()     <== traceback

Selection: 0

        
On Mon, Nov 23, 2009 at 7:52 PM, Hao Cen <hcen at andrew.cmu.edu> wrote:
http://old.nabble.com/Automatically-execute-traceback-when-execution-of-scri
pt-causes-error--td22368483.html#a22368775
http://www.R-project.org/posting-guide.html