Learn R Programming

rtape (version 2.2)

rtapeAdd: Add object to the tape.

Description

Add object to the tape.

Usage

rtapeAdd(fName, what, skipNULLs=FALSE, fileFormat=guessFileFormat(fName), safe=FALSE, retryTime=0.1)

Arguments

fName
Name of the tape file.
what
Object to be stored.
skipNULLs
If true and what is NULL, nothing is written to the tape.
fileFormat
File format; should be left default. See guessFileFormat and makeFileFormat for details.
safe
If "try" or "retry", rtape will use dirlock to ensure that no other rtape safe appending is in progress. In case of conflict, the function in "try" mode immediately returns FALSE and does not try again, while in "retry" mode it sleeps retryTime seconds and tries again till the dirlock is opened.
retryTime
If safe is "retry", this parameter sets the interval between writing attempts. Expressed in seconds.

Details

This function serializes and appends a given object on the end of the tape file. If the tape file does not exists, it is created.

Examples

Run this code
#Record something on the tape
rtapeAdd('tmp.tape',iris)
rtapeAdd('tmp.tape',sin(1:10))
#Read whole tape to the list, so we could examine it
rtapeAsList('tmp.tape')->stored
print(stored)
unlink('tmp.tape')

Run the code above in your browser using DataLab