| Line 129... |
Line 129... |
| 129 |
the user's workspace (and indeed, of replacing any object of that name
|
129 |
the user's workspace (and indeed, of replacing any object of that name
|
| 130 |
already there). It would almost always be better to put the object in
|
130 |
already there). It would almost always be better to put the object in
|
| 131 |
the current evaluation environment by
|
131 |
the current evaluation environment by
|
| 132 |
\code{data(\dots, envir = environment())}.
|
132 |
\code{data(\dots, envir = environment())}.
|
| 133 |
However, two alternatives are usually preferable,
|
133 |
However, two alternatives are usually preferable,
|
| 134 |
both described in the \sQuote{Writing R Extensions} manual.
|
134 |
both described in the \manual{R-exts}{} manual.
|
| 135 |
\itemize{
|
135 |
\itemize{
|
| 136 |
\item For sets of data, set up a package to use lazy-loading of data.
|
136 |
\item For sets of data, set up a package to use lazy-loading of data.
|
| 137 |
\item For objects which are system data, for example lookup tables
|
137 |
\item For objects which are system data, for example lookup tables
|
| 138 |
used in calculations within the function, use a file
|
138 |
used in calculations within the function, use a file
|
| 139 |
\file{R/sysdata.rda} in the package sources or create the objects by
|
139 |
\file{R/sysdata.rda} in the package sources or create the objects by
|
| Line 173... |
Line 173... |
| 173 |
\seealso{
|
173 |
\seealso{
|
| 174 |
\code{\link{help}} for obtaining documentation on data sets,
|
174 |
\code{\link{help}} for obtaining documentation on data sets,
|
| 175 |
\code{\link{save}} for \emph{creating} the second (\file{.rda}) kind
|
175 |
\code{\link{save}} for \emph{creating} the second (\file{.rda}) kind
|
| 176 |
of data, typically the most efficient one.
|
176 |
of data, typically the most efficient one.
|
| 177 |
|
177 |
|
| 178 |
The \sQuote{Writing R Extensions} manual for considerations in preparing the
|
178 |
Section \manual{R-exts}{Data in packages} for considerations in preparing the
|
| 179 |
\file{data} directory of a package.
|
179 |
\file{data} directory of a package.
|
| 180 |
}
|
180 |
}
|
| 181 |
\examples{
|
181 |
\examples{
|
| 182 |
require(utils)
|
182 |
require(utils)
|
| 183 |
data() # list all available data sets
|
183 |
data() # list all available data sets
|