[R] Clarification on debug output

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Oct 24 10:33:32 CEST 2014


On 24/10/2014 00:05, Mick Jordan wrote:
>
> I hope someone can explain what the #1 means (and for that matter the
> [2] in the debug output below. I can't find anything in the spec that
> explains what they mean.
>
> Thanks
>
>  > f(1)
> debugging in: f(1)
> debugging in: f()
> debug at #1: {

#1 is a 'srcref': see its help.  It is a line number in the source file 
(if this was recorded, which it is not by default for package code, for 
example).

>      if (x < 0)
>          -x
>      else x
> }
> Browse[2]>

'2' is the 'browser level': the browser can be called recursively.  It 
is a count of 'contexts', so the first browse is normally starting at 
context 2, and browsing from the browser gives 3 ....


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK



More information about the R-help mailing list