Session               package:methods               R Documentation

_S_e_s_s_i_o_n _D_a_t_a _a_n_d _D_e_b_u_g_g_i_n_g _T_o_o_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     The function `sessionData' provides a work-around in R for the
     absence of a session database (what you get in S with the argument
     `where=0' to functions such as `get' and `assign').

     The functions `traceOn', `traceOff' and `browseAll' are debugging
     tools with roughly similar functionality to `trace', `untrace' and
     `browser' as described in the reference.  Calling `traceOn'
     creates a new version of a function with arbitrary code inserted
     at the beginning of the call and/or on exit. Calling `traceOff'
     undoes the change.  The function `browseAll' is a useful
     interactive call to insert for tracing.  It behaves basically like
     `debugger'.

     Note:  use `traceOn' only for testing functions in a library, not
     for functions defined in the global environment.  Because the
     session data is in position 2 on the search list, the temporary
     versions stored there will not override functions in the global
     environment.

     A more satisfactory version of these  facilities is likely to be
     provided in the future.  Use the current versions but don't write
     code that depends on them.

_U_s_a_g_e:

     sessionData()

     traceOn(what, tracer=browseAll, exit=NULL)

     traceOff(what)

     browseAll()

_A_r_g_u_m_e_n_t_s:

    what: The object to be traced or untraced. 

tracer, exit: The code to use at the entrance or exit trace.  Either a
          function (which will be called with no arguments) or an
          expression (typically constructed from `link{quote}' or
          `substitute') to be evaluated. 

_D_e_t_a_i_l_s:

     `sessionData':  return the index of the session data in the search
     list, attaching it if it is not attached

     `traceOn':  initialize tracing on calls to function `what'.  The
     function or expression `tracer' is called on entry, and the
     function or expression `exit' on exit.

     `traceOff':  turn off tracing of this function

     `browseAll':  browse the current stack of function calls.

     Uses the function `debugger' to set up browser calls on the
     frames.  On exit from that function, computation continues after
     the call to browseAll.  Computations done in the frames will have
     no effect.

_A_u_t_h_o_r(_s):

     John Chambers

_R_e_f_e_r_e_n_c_e_s:

     See   Programming with Data (John M. Chambers, Springer, 1998) for
     the equivalent functions.

