2. Following are the debugging Flow
Debug, browser and trace
R programming (Debugging in R)
Overview
3. debug() works by marking functions for debugging.
When R starts to evaluate such a function, the evaluator
automatically breaks to the debugger.
Use debug(fun) to mark a function for debugging.
all undebug(fun) to remove the debugging flag from a
function
R programming (Debugging in R)
debug()
4. browser() function in R's base package allows you to single
step through the execution of an R function.
You can view and change objects during execution
R programming (Debugging in R)
browser()
5. The trace() function modifies a function to allow debug code
to be temporarily inserted
A call to trace allows you to insert debugging code
A call to untrace cancels the tracing
Specified methods can be traced the same way, without
tracing all calls to the function
Tracing can be temporarily turned on or off globally by
calling tracingState.
R programming (Debugging in R)
trace()