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 ...

