\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=T), 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, oldstyle = FALSE)
save.image(file = ".Rdata", oldstyle = FALSE)
\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.
\item[\code{oldstyle}] logical. Should the old (0.90.1 or earlier) format be used?
\end{ldescription}
\end{Arguments}
\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}

