\Header{warning}{Warning Messages}
\keyword{programming}{warning}
\keyword{error}{warning}
\begin{Description}\relax
Generates a warning message that corresponds to its argument(s) and
(optionally) the expression or function from which it was called.\end{Description}
\begin{Usage}
\begin{verbatim}
warning(..., call. = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] character vectors (which are pasted together with no
separator) or \code{NULL}.
\item[\code{call.}] logical, indicating if the call should become part of the
warning message.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The result \emph{depends} on the value of
\code{\Link{options}("warn")}.

If \code{warn} is negative warnings are ignored; if it is zero they
are stored and printed after the top--level function has completed; if
it is one they are printed as they occur and if it is 2 (or larger)
warnings are turned into errors.

If \code{warn} is zero (the default), a top-level variable
\code{last.warning} is created.  It contains the warnings which can be
printed via a call to \code{\Link{warnings}}.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{stop}} for fatal errors,
\code{\Link{warnings}},
and \code{\Link{options}} with argument \code{warn=}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

testit <- function() warning("testit")
testit() ## shows call
testit <- function() warning("problem in testit", call. = FALSE)
testit() ## no call

\end{ExampleCode}
\end{Examples}

