Learn R Programming

TRAMPR (version 1.0-10)

read.write: Read/Write TRAMPknowns and TRAMPsamples Objects

Description

Saves and loads TRAMPknowns and TRAMPsamples objects as a series of “csv” (comma separated value) files for external editing.

If you do not want to edit your data, then saving with save is preferable; it is faster, creates smaller files, and will save any additional components in the objects (see Examples).

Usage

read.TRAMPknowns(file.pat, auto.save=TRUE, overwrite=FALSE)
write.TRAMPknowns(x, file.pat=x$file.pat, warn=TRUE)

read.TRAMPsamples(file.pat) write.TRAMPsamples(x, file.pat)

Arguments

file.pat

Pattern, with the filename prefix: “info” and “data” objects will be read/written as <file.pat>_info.csv and <file.pat>_data.csv, respectively.

auto.save

Logical: Should TRAMPknowns object be automatically saved back to the loaded filename as it is modified (e.g. knowns added to the database). If this is TRUE, the original files will be backed up as

<file.pat>_(info|data)_<YYYYMMDD>.csv,

where <YYYYMMDD> is the ISO date.

overwrite

Should previous backup files be overwritten when creating new backups?

warn

Should the function warn when no filename is given? (Because this function is called automatically when adding new knowns, and because TRAMPknowns objects need not contain a file.pat element, it may not be possible or neccesary to save).

Details

file.pat may contain a path. It is best to use forward slashes as directory separators (path/to/file), but on Windows (only), double backslashes will also work (path\\to\\file).

Paths may be either relative (e.g. path/to/file), or absolute (e.g. /path/to/file, or x:/path/to/file on Windows).

See Also

load.abi, for semi-automatic loading of ABI output files.

save and load, for saving and loading of arbitrary R objects.

Examples

Run this code
# NOT RUN {
# Preferred way of saving/loading objects, if editing is not required:
save(demo.knowns, file="my_knowns.Rdata")

# (possibly in a different session, but _after_ loading TRAMP)
load("my_knowns.Rdata") # -> creates 'demo.knowns' in global environment
# }

Run the code above in your browser using DataLab