This tool, debugR, available here. greatly enhances the R debugging process. R's own built-in debugging tools are very limited, but debugR extends them to a rich set of commands, plus visual display of your execution of the debuggee. Those who have used GDB for C/C++ will find many similarities, but no such background is assumed. (Note: RStudio now has a built-in debugging tool, as do ESS and statet.)
(I am no longer supporting edtdbg.)
The tool needs a Linux or other Unix-family environment, e.g. Macs. It should work on Cygwin. (I may have a Windows version soon.) Python is also required.
f <- function() { sum <- 0 for (i in 1:3) { sum <- sum + i } sum }
python debugR.py test.R
df f
to set the function f() to debug status. Then in the command area, type
rn f()
to run the function f(). (No arguments in this particular call, but of course you could have some for other functions.)
You can then type n for next line, c for continue, etc., rather like GDB. Type Q to quit the browser, and es to leave the debugging tool.