[R] debugging a code

Gabor Grothendieck ggrothendieck at myway.com
Thu Mar 25 01:34:32 CET 2004


You also have carriage return as a debug command.  I think
you are looking for:

  ?recover

Fred J. <phddas <at> yahoo.com> writes:

: 
: Hello
: just learned HowTo but R, reminded me with the way
: Perl does it but with much less on-line commands, R
: "AFAIK" has n, c, Q and where and cann't debug outside
: the {}. 
: 
: 1) is there a more versatile/flexable debugging method
: for R?
: 
: I have saved 2 functions in an ASCII file "digfun".
: "getdata" function calls "squash" function and both
: use loops. In another file.R I have
: 
: source("digfun")
: debug(getdata)
: data <- getdata("c:/data/")
: 
: Browse[1]> c
: Error in if (d[i, "V3"] == d[i + 1, "V3"] && d[i,
: "V4"] == d[i + 1, "V4"] &&  : 
: 	missing value where TRUE/FALSE needed
: : traceback()
: 2: squash(dt1)
: 1: getdata("c:/data/")
: : 
: to dubug this I need to know the value of some
: variable at this particular loop/sub-fun loop case,
: and since the dubuger terminated by showing ">"
: prompt, how then I am going to debug this error?
: 
: thanks for helping
: 
: ______________________________________________
: R-help <at> stat.math.ethz.ch mailing list
: https://www.stat.math.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