data.dump
into the specified database.
data.restore(connection, print=F, where=1)
TRUE
, print a single line summary of each object, just
before it is restored from the file.
connection
are placed
in the
where
directory.
A summary of the objects is printed if
print
is
TRUE
.
Normally, the file supplied to
data.restore
was previously created
(maybe on another machine) by a call to
data.dump
.
The objects should exactly reproduce those dumped, up to numerical
differences arising from inter-machine incompatibility. In particular,
the classes of objects and their components are retained. The definitions
of the same class on the original database need to be compatible with
those on the restored database. Since meta-data can also be dumped and
restored by
data.dump
and
data.restore
, it is good practice when in
doubt to dump the meta-objects referring to a newly defined class as well.
These should be restored first, and then any objects from this class.
The
data.restore
function looks for a header on the file identifying
it as ordinary or meta-data. If neither pre-defined header is found,
the file is assumed to be from an older version of S-PLUS. You shouldn't
have to worry about this; so long as objects are dumped by
data.dump
and restored consistently by
data.restore
, everything should work.
This function is not affected by the current search list.
data.dump(objects(),file="all.data") data.restore("all.data") # suppose "myNewClass" is a newly defined class data.dump(metaObjects(1, p = "myNewClass"), "forMyNewClass", meta=T) # ... and then later data.restore("myNewClass") # no meta= argument needed # now go on to dump and restore objects of this class