Use new create/deleteLockFile functions
[filehash.git] / man / dump.Rd
blob9a38ecb7c01b4c170cf8e42eda648314a017ce5d
1 \name{dumpObjects}
2 \alias{dumpObjects}
3 \alias{dumpImage}
4 \alias{dumpDF}
5 \alias{dumpList}
7 \title{Dump objects of database}
8 \description{
9   Dump R objects to a filehash database
11 \usage{
12 dumpObjects(..., list = character(0), dbName, type = NULL, envir = parent.frame())
13 dumpImage(dbName = "Rworkspace", type = NULL)
14 dumpDF(data, dbName = NULL, type = NULL)
15 dumpList(data, dbName = NULL, type = NULL)
18 \arguments{
19   \item{\dots}{R objects to dump}
20   \item{list}{character vector of names of objects to dump}
21   \item{dbName}{character, name of database to which objects should be
22     dumped}
23   \item{type}{type of database to create}
24   \item{envir}{environment from which to obtain objects}
25   \item{data}{a data frame or a list}
27 \details{
28   Objects dumped to a database can later be loaded via \code{dbLoad} or
29   can be accessed with \code{dbFetch}, \code{dbList}, etc.
30   Alternatively, the \code{with} method can be used to evaluate code in
31   the context of a database.  If a database with name \code{dbName}
32   already exists, objects will be inserted into the existing database
33   (and values for already-existing keys will be overwritten).
35   \code{dumpDF} is different in that each variable in the data frame is
36   stored as a separate object in the database.  So each variable can be
37   read from the database separately rather than having to load the
38   entire data frame into memory.  \code{dumpList} works in a simlar
39   way.
42 \value{
43   An object of class \code{"filehash"} is returned and a database is
44   created.
47 \author{Roger D. Peng}
49 \examples{
50 data <- data.frame(y = rnorm(100), x = rnorm(100), z = rnorm(100))
51 db <- dumpDF(data, dbName = "dataframe.dump")
52 fit <- with(db, lm(y ~ x + z))
53 summary(fit)
55 db <- dumpList(list(a = 1, b = 2, c = 3), "list.dump")
56 db$a
58 \keyword{database}% at least one, from doc/KEYWORDS