Produce Text Representations of S-PLUS Objects

DESCRIPTION:

Creates an ASCII file representing a group of S-PLUS objects, suitable for editing.

USAGE:

dump(list, fileout="dumpdata.q" <<see below>>, full.precision = T,
     test, oldStyle = T, ...) 

REQUIRED ARGUMENTS:

list
character vector giving the names of data objects.

OPTIONAL ARGUMENTS:

fileout
character name of a file on which the objects will be dumped. The default is "dumpdata.q", unless list contains only one name, in which case a name based on that name is used, e.g. "x.q".
full.precision
logical flag; should the dumped data be printed with enough digits to retain full binary precision when restored?
test
an optional function to test whether we really want to dump this object. The function will be called for each object in list, with the object (not its name) as the only argument. For example, supplying test=is.function will dump only the function objects among those mentioned in list.
...
optional additional arguments passed to the get function. For example, where="main" specifies which database to use to get the objects.
oldStyle
logical flag; should the file be written in a form that can be read by earlier versions of S-PLUS? If F, then the file will not be readable by versions of S-PLUS earlier than 5.0 (Unix) or 6.0 (Windows).

VALUE:

the character string fileout is returned.

SIDE EFFECTS:

Text (deparsed) representations of the objects given in list are written to file fileout.

DETAILS:

This function is primarily used for creating text representations of function objects, suitable for modification using an external editor. Do not use dump to transfer data objects between S-PLUS sessions; use the related function data.dump for this purpose.

The files created by dump are ASCII text, and can be shipped to other machines that may have different binary representations of S-PLUS objects. The shipped file can then be used to restore the objects, either with source for small files, or with restore.

The mode of numeric data may be changed due to a dump / restore sequence, and the internal structure of a function object may be changed (with different white space when printing). The restoration of large data objects that were created by dump may take inordinate amounts of memory. source and restore will not be able to properly read an object with a call component, such as modeling or trellis objects (it will try to evaluate the call component). (More generally, any S-PLUS language object is not suitable for dump since source and restore evaluates the contents of the dump file.) The functions data.dump and data.restore are recommended and have none of these drawbacks. If the data contain objects of arbitrary classes, you must use data.dump: the parser can't guarantee to reproduce arbitrary objects exactly.

In general, use dump only when it is important that you be able to read and edit the file. For backing up data or transferring data to other machines use data.dump.

SEE ALSO:

, , , .

EXAMPLES:

dump(objects(), "all.files") 
dump(c("x", "y", "reg.xy"))