traceback                package:base                R Documentation

_P_r_i_n_t _C_a_l_l _S_t_a_c_k _o_f _L_a_s_t _E_r_r_o_r

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

     `traceback()' prints the call stack of the last error, i.e., the
     sequence of calls that lead to the error.  This is useful when an
     error occurs with an unidentifiable error message. Currently, this
     stack is given as a list in `.Traceback'.

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

     traceback()

_E_x_a_m_p_l_e_s:

     foo <- function(x) { print(1); bar(2) }
     bar <- function(x) { x + a.variable.which.does.not.exist }

     foo(2) # gives a strange error
     traceback()
     ## [1] "bar(2)" "foo(2)"
     bar
     ## Ah, this is the culprit ...

