Debugging with

I just found these two gems about debugging in R on r-help today (here is the thread):

1) posted by Thomas Lumley:

traceback() gets you a stack trace at the last error

options(warn=2) makes warnings into errors

options(error=recover) starts the post-mortem debugger at any error,
allowing you to inspect the stack interactively.

2) added by  William Dunlap:

options(warning.expression=quote(recover()))
will start that same debugger at each warning.

I think these are very useful ideas to remember – thanks.

Cheers, and enjoy life.

Advertisements

One response to “Debugging with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s