\Header{dump}{Text Representations of R Objects}
\keyword{file}{dump}
\keyword{connection}{dump}
\begin{Description}\relax
This function takes a vector of names of \R{} objects and produces
text representations of the objects on a file or connection.
A \code{dump} file can be \code{\Link{source}}d into another
\R{} (or S) session.\end{Description}
\begin{Usage}
\begin{verbatim}
dump(list, file = "dumpdata.R", append = FALSE, envir = parent.frame())
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{list}] character. The names of one or more \R{} objects to be dumped.
\item[\code{file}] either a character string naming a file or a
connection. \code{""} indicates output to the console.
\item[\code{append}] if \code{TRUE}, output will be appended to
\code{file}; otherwise, it will overwrite the contents of
\code{file}.
\item[\code{envir}] the environment to search for objects.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
At present the implementation of \code{dump} is very
incomplete and it really only works for functions and
simple vectors.

\code{dump} will warn if fewer characters were written to a file than
expected, which may indicate a full or corrupt file system.

The function \code{\Link{save}} is designed to be used for
transporting \R{} data between machines.\end{Details}
\begin{Note}\relax
The \code{envir} argument was added at version 1.7.0, and changed the
search path for named objects to include the environment from which
\code{dump} was called.

As \code{dump} is defined in the base namespace, the \pkg{base}
package will be searched \emph{before} the global environment unless
\code{dump} is called from the top level or the \code{envir} argument
is given explicitly.\end{Note}
\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{SeeAlso}\relax
\code{\Link{dput}}, \code{\Link{dget}},\code{\Link{write}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- 1; y <- 1:10
dump(ls(patt='^[xyz]'), "xyz.Rdmped")
unlink("xyz.Rdmped")
\end{ExampleCode}
\end{Examples}

