ffbase (version 0.12.7)

save.ffdf: Save ffdf data.frames in a directory

Description

save.ffdf saves all ffdf data.frames in the given dir. Each column is stored as with filename <ffdfname>$<colname>.ff. All variables given in "..." are stored in ".RData" in the same directory. The data can be reloaded by starting a R session in the directory or by using load.ffdf. Note that calling save.ffdf multiple times for the same directory will only store the ffdf's that were given in the last call.

Usage

save.ffdf(..., dir = "./ffdb", clone = FALSE, relativepath = TRUE,
  overwrite = FALSE)

Arguments

...

ffdf data.frames, ff vectors, or other variables to be saved in the directory

dir

path where .RData file will be saved and all columns of supplied ffdf's. It will be created if it doesn't exist.

clone

should the ff vectors be clone'd, creating a snapshot of the supplied ffdf or ff objects? This should only be necessary if you still need the ff vectors in their current storage location.

relativepath

logical if TRUE the stored ff vectors will have relative paths, making moving the data to another storage a simple copy operation.

overwrite

logical If TRUE save.ffdf will overwrite an previous stored ffdf, .Rdata file.

Details

Using save.ffdf automagically sets the finalizers of the ff vectors to "close". This means that the data will be preserved on disk when the object is removed or the R sessions is closed. Data can be deleted either using delete or by removing the directory where the object were saved (dir).

See Also

load.ffdf

Examples

Run this code
# NOT RUN {
iris.ffdf <- as.ffdf(iris)

td <- tempfile()

# save the ffdf into the supplied directory
save.ffdf(iris.ffdf, dir=td)

# what in the directory?
dir(td)

#remove the ffdf from memory
rm("iris.ffdf")

# and reload the stored ffdf
load.ffdf(dir=td)

tf <- paste(tempfile(), ".zip", sep="")
packed <- pack.ffdf(file=tf, iris.ffdf)

#remove the ffdf from memory
rm("iris.ffdf")

# restore the ffdf from the packed ffdf
unpack.ffdf(tf)
# }

Run the code above in your browser using DataLab