This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/debug.html
debug {base}R Documentation

Debug a function

Description

These functions set and unset the debugging flag on a function. When a function flagged for debugging is entered, normal execution is suspended and the body of function is executed on statement at a time. A new browser context is initiated for each step (and the previous one destroyed). Currently you can only debug functions that have bodies enclosed in braces. This is a bug and will be fixed soon. You take the next step by typing carriage return, n or next. You can see the values of variables by typing their names. Typing c or cont causes the debugger to continue to the end of the function. You can debug new functions before you step in to them from inside the debugger. If you have variables with names that are identical to the controls (eg. c or n ) then you need to use print(c) and print(n) to evaluate them.

Usage

debug(fun)
undebug(fun)

Arguments

fun

any interpreted R function.

See Also

browser.


[Package base version 0.60 ]