\Header{traceback}{Print Call Stack of Last Error}
\alias{.Traceback}{traceback}
\keyword{programming}{traceback}
\begin{Description}\relax
\code{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.
This stack is stored as a list in \code{.Traceback},
which \code{traceback} prints in a user-friendly format.\end{Description}
\begin{Usage}
\begin{verbatim}
traceback()
\end{verbatim}
\end{Usage}
\begin{Value}
\code{traceback()} returns nothing, but prints the deparsed call stack
deepest call first.  The calls may print on more that one line, and
the first line is labelled by the frame number.\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.\end{References}
\begin{Examples}
\begin{ExampleCode}
foo <- function(x) { print(1); bar(2) }
bar <- function(x) { x + a.variable.which.does.not.exist }
## Don't run: 
foo(2) # gives a strange error
traceback()
## End Don't run
## 2: bar(2)
## 1: foo(2)
bar
## Ah, this is the culprit ...
\end{ExampleCode}
\end{Examples}

