[R] step by step debugger in R?

Romain Francois romain.francois at dbmail.com
Fri May 22 19:34:46 CEST 2009

Duncan Murdoch wrote:
> On 5/22/2009 10:59 AM, Michael wrote:
>> Really I think if there is a Visual Studio strength debugger, our
>> collective time spent in developing R code will be greatly reduced.
> If someone who knows how to write a debugger plugin for Eclipse wants 
> to help, we could have that fairly easily.  All the infrastructure is 
> there; it's the UI part that's missing.
> Duncan Murdoch
[I've copied Mark Bravington and Robert Gentleman to the list as they 
are likely to have views here, and I am not sure they monitor R-help]


Making a front-end to debugging was one of the proposed google summer of 
code for this year [1], it was not retained eventually, but I am still 

Pretty much all infrastructure is there, and some work has been done 
__very recently__ in R's debugging internals (ability to step up). As I 
see it, the ability to call some sort of hook each time the debugger 
waits for input would make it much easier for someone to write 
front-ends. A recent post of mine (patch included) [2] on R-devel 
suggested a custom prompt for browser which would do the trick, but I 
now think that a hook would be more appropriate. Without something 
similar to that, there is no way that I know of for making a front-end, 
unless maybe if you embed R ... (please let me know how I am wrong)

There is also the debug package [3,4] which does __not__ work with R 
internals but rather works with instrumenting tricks at the R level. 
debug provides a tcl/tk front-end. It is my understanding that it does 
not work using R internals (do_browser, ...) because it was not possible 
at the time, and I believe this is still not possible today, but I might 
be wrong. I'd prefer to be wrong actually.


[1] : http://www.r-project.org/soc09/ideas.html#p5
[2] : https://stat.ethz.ch/pipermail/r-devel/2009-April/053128.html
[3] : http://cran.r-project.org/web/packages/debug/index.html
[4] : http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf

Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30

More information about the R-help mailing list