| Line 4... |
Line 4... |
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{dump}
|
6 |
\name{dump}
|
| 7 |
\title{Text Representations of R Objects}
|
7 |
\title{Text Representations of R Objects}
|
| 8 |
\usage{
|
8 |
\usage{
|
| 9 |
dump(list, file = "dumpdata.R", append = FALSE,
|
9 |
dump(list, file = "dumpdata.R", append = FALSE,
|
| 10 |
control = "all", envir = parent.frame(), evaluate = TRUE)
|
10 |
control = "all", envir = parent.frame(), evaluate = TRUE)
|
| 11 |
}
|
11 |
}
|
| 12 |
\alias{dump}
|
12 |
\alias{dump}
|
| 13 |
\description{
|
13 |
\description{
|
| 14 |
This function takes a vector of names of \R objects and produces
|
14 |
This function takes a vector of names of \R objects and produces
|
| Line 23... |
Line 23... |
| 23 |
\link{connection}. \code{""} indicates output to the console.}
|
23 |
\link{connection}. \code{""} indicates output to the console.}
|
| 24 |
|
24 |
|
| 25 |
\item{append}{if \code{TRUE} and \code{file} is a character string,
|
25 |
\item{append}{if \code{TRUE} and \code{file} is a character string,
|
| 26 |
output will be appended to \code{file}; otherwise, it will overwrite
|
26 |
output will be appended to \code{file}; otherwise, it will overwrite
|
| 27 |
the contents of \code{file}.}
|
27 |
the contents of \code{file}.}
|
| 28 |
|
28 |
|
| 29 |
\item{control}{character vector indicating deparsing options.
|
29 |
\item{control}{character vector indicating deparsing options.
|
| 30 |
See \code{\link{.deparseOpts}} for their description.}
|
30 |
See \code{\link{.deparseOpts}} for their description.}
|
| 31 |
|
31 |
|
| 32 |
\item{envir}{the environment to search for objects.}
|
32 |
\item{envir}{the environment to search for objects.}
|
| 33 |
|
33 |
|
| Line 35... |
Line 35... |
| 35 |
}
|
35 |
}
|
| 36 |
\details{
|
36 |
\details{
|
| 37 |
If some of the objects named do not exist (in scope), they are
|
37 |
If some of the objects named do not exist (in scope), they are
|
| 38 |
omitted, with a warning. If \code{file} is a file and no objects
|
38 |
omitted, with a warning. If \code{file} is a file and no objects
|
| 39 |
exist then no file is created.
|
39 |
exist then no file is created.
|
| 40 |
|
40 |
|
| 41 |
\code{source}ing may not produce an identical copy of
|
41 |
\code{source}ing may not produce an identical copy of
|
| 42 |
\code{dump}ed objects. A warning is issued if it is likely that
|
42 |
\code{dump}ed objects. A warning is issued if it is likely that
|
| 43 |
problems will arise, for example when dumping exotic or complex
|
43 |
problems will arise, for example when dumping exotic or complex
|
| 44 |
objects (see the Note).
|
44 |
objects (see the Note).
|
| 45 |
|
45 |
|
| Line 48... |
Line 48... |
| 48 |
|
48 |
|
| 49 |
A \code{dump} file can be \code{\link{source}}d into another \R (or
|
49 |
A \code{dump} file can be \code{\link{source}}d into another \R (or
|
| 50 |
perhaps S) session, but the function \code{\link{save}} is designed to
|
50 |
perhaps S) session, but the function \code{\link{save}} is designed to
|
| 51 |
be used for transporting \R data, and will work with \R objects that
|
51 |
be used for transporting \R data, and will work with \R objects that
|
| 52 |
\code{dump} does not handle.
|
52 |
\code{dump} does not handle.
|
| 53 |
|
53 |
|
| 54 |
To produce a more readable representation of an object, use
|
54 |
To produce a more readable representation of an object, use
|
| 55 |
\code{control = NULL}. This will skip attributes, and will make other
|
55 |
\code{control = NULL}. This will skip attributes, and will make other
|
| 56 |
simplifications that make \code{source} less likely to produce an
|
56 |
simplifications that make \code{source} less likely to produce an
|
| 57 |
identical copy. See \code{\link{deparse}} for details.
|
57 |
identical copy. See \code{\link{deparse}} for details.
|
| 58 |
|
58 |
|
| 59 |
To deparse the internal representation of a function rather than
|
59 |
To deparse the internal representation of a function rather than
|
| 60 |
displaying the saved source, use \code{control = c("keepInteger",
|
60 |
displaying the saved source, use \code{control = c("keepInteger",
|
| 61 |
"warnIncomplete", "keepNA")}. This will lose all formatting and
|
61 |
"warnIncomplete", "keepNA")}. This will lose all formatting and
|
| 62 |
comments, but may be useful in those cases where the saved source is
|
62 |
comments, but may be useful in those cases where the saved source is
|
| 63 |
no longer correct.
|
63 |
no longer correct.
|
| Line 74... |
Line 74... |
| 74 |
\note{
|
74 |
\note{
|
| 75 |
As \code{dump} is defined in the base namespace, the \pkg{base}
|
75 |
As \code{dump} is defined in the base namespace, the \pkg{base}
|
| 76 |
package will be searched \emph{before} the global environment unless
|
76 |
package will be searched \emph{before} the global environment unless
|
| 77 |
\code{dump} is called from the top level prompt or the \code{envir}
|
77 |
\code{dump} is called from the top level prompt or the \code{envir}
|
| 78 |
argument is given explicitly.
|
78 |
argument is given explicitly.
|
| 79 |
|
79 |
|
| 80 |
To avoid the risk of a source attribute becoming out of sync with the
|
80 |
To avoid the risk of a source attribute becoming out of sync with the
|
| 81 |
actual function definition, the source attribute of a function will
|
81 |
actual function definition, the source attribute of a function will
|
| 82 |
never be dumped as an attribute.
|
82 |
never be dumped as an attribute.
|
| 83 |
|
83 |
|
| 84 |
Currently environments, external pointers, weak references and objects
|
84 |
Currently environments, external pointers, weak references and objects
|