[R] get the bug context

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun May 29 22:04:08 CEST 2005

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
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

More information about the R-help mailing list