Skip to content
Prev 58727 / 398506 Next

R code debugging

On Tue, 9 Nov 2004, Timur Elzhov wrote:

            
R code can be created dynamically by R code (called `computing on the
language'), and in most cases the source code is not retained (and it is
not used for execution).

traceback() will always tell you the function in which the error occurred.
If you write reasonably modular code that should suffice, but if not,
use debug() on that function and single-step through it to find where the 
error occurs.  Or set a suitable error handler: have you explored 
recover(), for example?