conditionarguments are the same as those that can be supplied via a call to
browser. They can be retrieved by the user once the browser has been entered, and provide a mechanism to allow users to identify which breakpoint has been activated.
debug(fun, text = "", condition = NULL) debugonce(fun, text = "", condition = NULL) undebug(fun) isdebugged(fun) debuggingState(on = NULL)
TRUEif debugging is globally turned on,
FALSEotherwise. An argument of one or the other of those values sets the state. If the debugging state is
FALSE, none of the debugging actions will occur (but explicit
browsercalls in functions will continue to work).
At the debug prompt the user can enter commands or R expressions,
followed by a newline. The commands are described in the
browser help topic.
To debug a function which is defined inside another function,
single-step though to the end of its definition, and then call
debug on its name.
If you want to debug a function not starting at the very beginning,
trace(..., at = *) or
debug is persistent, and unless debugging is turned off
the debugger will be entered on every invocation (note that if the
function is removed and replaced the debug state is not preserved).
debugonce to enter the debugger only the next time the
function is invoked.
In order to debug S4 methods (see
need to use
trace, typically calling
trace("plot", browser, exit = browser, signature = c("track", "missing"))
The number of lines printed for the deparsed call when a function is
entered for debugging can be limited by setting
When debugging is enabled on a byte compiled function then the interpreted version of the function will be used until debugging is disabled.
tracebackto see the stack after an
recoverfor another debugging approach.