rtapeLapply: Iterate over tape, gathering results.
Description
Iterate over tape, gathering results.
Usage
rtapeLapply(fNames, FUN, ...)
Arguments
fNames
Name of the tape file to read; if this argument is a vector of several names, function behaves as reading a single tape made of all those tapes joined in a given order.
FUN
Callback function.
...
Additional parameters to FUN.
Value
FUN calls.
Details
This function read the tape from the oldest to the newest writes and executes the callback function on each read object. Logically, it is an equivalent to lapply(rtapeAsList(fName),FUN,...), but it is optimized to store only the currently processed object in the memory.
#Record something on the tapertapeAdd('tmp.tape',runif(3))
rtapeAdd('tmp.tape',rnorm(3))
#Print tape contentsrtape_apply('tmp.tape',print)
unlink('tmp.tape')