dbread,
dbwrite,
dbobjects, and
dbremove
functions are deprecated. For more information, see
.
dbread(database, name) dbwrite(database, name, object) dbobjects(database) dbexists(database, name, mode = "any") dbremove(database, name) dbdetach(database, where)
database.
database on the search list.
dbread returns the dataset associated with
name on the
database.
dbobjects returns a character vector giving
the names of all objects currently on the
database.
dbexists returns a logical value telling whether there
is something named
name on the
database.
dbdetach.default (and other methods) return
database, however,
methods for user defined databases often will not want to return
the entire database.
dbwrite stores
object on the
database under the given
name.
dbremove removes the object stored on
database under the given
name.
These are all generic functions.
Currently
dbread,
dbwrite,
dbobjects, and
dbremove only have a
default method, and
dbexists has no methods at all.
The
dbdetach function has methods for
data.frame
and
pframe, and a default method.
The
dbdetach function is used in
detach.
If
dbobjects returns a character vector of length
0, it means
that there is nothing currently on the database.
If it returns a
NULL, it means that existence of any object
should be determined by trying to operate on it.
This is useful for large databases where it is infeasible to return
the list of all objects.
Note that in this case there
mustbe a
dbexists method.
The value of
dbobjects can have an attribute
"keep" that controls
whether objects read from the database will be kept in memory.
For example, if the value of
the attribute is
"any", then any object read from the database remains
in memory for as long as the database is attached;
if the value is
"function", all functions read from the database
will remain in memory beyond the current expression.
Any other value (say
"null") means that
no objects will from the database will be kept in main memory.
If the attribute is not present, the value of
options("keep") determines
the behavior, in the same way.
Note that these expression functions are experimental and are not meant to be called directly.
If you define a new class of database, then
attach,
assign,
get,
remove,
and
exists call
dbobjects,
dbread, etc. in various ways. For example,
get("x",db) will
not call
dbread("x",db) unless
xis in the output of
dbobjects(db).)