Learn R Programming

ffbase (version 0.6-2)

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 $.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.

Usage

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

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 data.frame be cloned?
relativepath
logical if TRUE the stored ff vectors will have relative paths, making moving the data to another storage a simple copy operation.

See Also

load.ffdf

Examples

Run this code
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