debug                  package:base                  R Documentation

_D_e_b_u_g _a _f_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Set or unset the debugging flag on a function.

_U_s_a_g_e:

     debug(fun)
     undebug(fun)

_A_r_g_u_m_e_n_t_s:

     fun: any interpreted R function.

_D_e_t_a_i_l_s:

     When a function flagged for debugging is entered, normal execution
     is suspended and the body of function is executed one statement at
     a time. A new browser context is initiated for each step (and the
     previous one destroyed). 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 (or loop if within a loop).
     You can 'debug' new functions before you step in to them from
     inside the debugger. Typing 'Q' quits the current execution and
     returns you to the top-level prompt. Typing 'where' causes the
     debugger to print out the current stack trace (all functions that
     are active). 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.

_S_e_e _A_l_s_o:

     'browser', 'traceback' to see the stack after an 'Error: ...'
     message; 'recover' for another debugging approach.

