-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Prof
Brian Ripley
Sent: Tuesday, November 09, 2004 4:16 AM
To: Timur Elzhov
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] R code debugging
On Tue, 9 Nov 2004, Timur Elzhov wrote:
it's quite difficult for me to find `Error:'s in my R code,
does say about error itself, but say nothing about its
string number and file with an error (which may be
`source'd from another file).
Are there any option for turning of the similar feature, or
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?
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595