\Header{save}{Save R Objects}
\methalias{save.image}{save}
\keyword{file}{save}
\begin{Description}\relax
\code{save} writes a external representation of \R{} objects to the
specified file.  The objects can be read back from the file at a later
date by using the function \code{load}.

\code{save.image()} is just a short-cut for ``save my current
environment'',
i.e., \code{save(list = ls(all=TRUE), file = ".RData")}. It is what also
happens with \code{\Link{q}("yes")}.\end{Description}
\begin{Usage}
\begin{verbatim}
save(..., list = character(0), file = "", ascii = FALSE)
save.image(file = ".Rdata")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] the names of the objects to be saved.
\item[\code{list}] A character vector containing the names of objects to be
saved.
\item[\code{file}] the name of the file where the data will be saved.
\item[\code{ascii}] if \code{TRUE}, an ASCII representation of the data is
written.  This is useful for transporting data between machines of
different types.  The default value of \code{ascii} is \code{FALSE}
which leads to a more compact binary file being written.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Almost all current \R{} platforms (including Windows) use the XDR
representation of binary objects in binary save-d files, and these are
portable across all XDR-compliant implementations.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{dput}}, \code{\Link{dump}}, \code{\Link{load}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- runif(20)
y <- list(a = 1, b = TRUE, c = "oops")
save(x, y, file = "xy.Rdata")
save.image()
unlink("xy.Rdata")
unlink(".RData")
\end{ExampleCode}
\end{Examples}

