Re: [R] get the bug context

From: Uwe Ligges <>
Date: Mon 30 May 2005 - 06:04:08 EST

Luke wrote:
> Hi R-users,
> How to get a bug contex?
> My R code ran there for several hours, but a bug crashed it, printing
> such message like "Error: subscript out of bounds". I want to use
> browser() to catch the bug, but I don't know which loop caused the bug
> (there are many loops in the code). I even don't know which line of
> code caused the bug. Is there any utility or something in R which can
> let you know which line of code causes a bug?

No, but ...

Have you tried traceback() to see which function is the culprit?

You can also set options(error = recover) to look at the objects at the time the error occured. Maybe you see which object is already defined and can derive the point of the error that way.

Uwe Ligges

> Thanks,
> -Luke
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Mon May 30 06:09:44 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:15 EST