ff: memory-efficient storage of large data on disk and fast access functions

The ff package provides data structures that are stored on disk but behave (almost) as if they were in RAM by transparently mapping only a section (pagesize) in main memory - the effective virtual memory consumption per ff object. ff supports R's standard atomic data types 'double', 'logical', 'raw' and 'integer' and non-standard atomic types boolean (1 bit), quad (2 bit unsigned), nibble (4 bit unsigned), byte (1 byte signed with NAs), ubyte (1 byte unsigned), short (2 byte signed with NAs), ushort (2 byte unsigned), single (4 byte float with NAs). For example 'quad' allows efficient storage of genomic data as an 'A','T','G','C' factor. The unsigned types support 'circular' arithmetic. There is also support for close-to-atomic types 'factor', 'ordered', 'POSIXct', 'Date' and custom close-to-atomic types. ff not only has native C-support for vectors, matrices and arrays with flexible dimorder (major column-order, major row-order and generalizations for arrays). There is also a ffdf class not unlike data.frames and import/export filters for csv files. ff objects store raw data in binary flat files in native encoding, and complement this with metadata stored in R as physical and virtual attributes. ff objects have well-defined hybrid copying semantics, which gives rise to certain performance improvements through virtualization. ff objects can be stored and reopened across R sessions. ff files can be shared by multiple ff R objects (using different data en/de-coding schemes) in the same process or from multiple R processes to exploit parallelism. A wide choice of finalizer options allows to work with 'permanent' files as well as creating/removing 'temporary' ff files completely transparent to the user. On certain OS/Filesystem combinations, creating the ff files works without notable delay thanks to using sparse file allocation. Several access optimization techniques such as Hybrid Index Preprocessing and Virtualization are implemented to achieve good performance even with large datasets, for example virtual matrix transpose without touching a single byte on disk. Further, to reduce disk I/O, 'logicals' and non-standard data types get stored native and compact on binary flat files i.e. logicals take up exactly 2 bits to represent TRUE, FALSE and NA. Beyond basic access functions, the ff package also provides compatibility functions that facilitate writing code for ff and ram objects and support for batch processing on ff objects (e.g. as.ram, as.ff, ffapply). ff interfaces closely with functionality from package 'bit': chunked looping, fast bit operations and coercions between different objects that can store subscript information ('bit', 'bitwhich', ff 'boolean', ri range index, hi hybrid index). This allows to work interactively with selections of large datasets and quickly modify selection criteria. Further high-performance enhancements can be made available upon request.

Author
Daniel Adler <dadler@uni-goettingen.de>, Christian Glser <christian_glaeser@gmx.de>, Oleg Nenadic <onenadi@uni-goettingen.de>, Jens Oehlschlgel <Jens.Oehlschlaegel@truecluster.com>, Walter Zucchini <wzucchi@uni-goettingen.de>
Date of publication
2014-04-09 09:54:20
Maintainer
Jens Oehlschlgel <Jens.Oehlschlaegel@truecluster.com>
License
GPL-2 | file LICENSE
Version
2.2-13
URLs

View on CRAN

Files in this package

ff
ff/inst
ff/inst/README_devel.txt
ff/inst/ANNOUNCEMENT-2.1.2.txt
ff/inst/ANNOUNCEMENT-2.2.txt
ff/inst/ANNOUNCEMENT-2.0.txt
ff/inst/ANNOUNCEMENT-2.1.txt
ff/configure.ac
ff/exec
ff/exec/prebuild.sh
ff/exec/make_rd.pl
ff/src
ff/src/Error.hpp
ff/src/r_file_resize.h
ff/src/r_ff_methodswitch.h
ff/src/FileMapping.hpp
ff/src/r_ff_addgetset.h
ff/src/Win32FileMapping.cpp
ff/src/utk_file_resize_ftruncate.hpp
ff/src/utk_file_allocate_fseek.hpp
ff/src/r_ff.c
ff/src/MMapFileMapping.cpp
ff/src/utk_config.hpp
ff/src/ac_config.h
ff/src/ac_config.h.in
ff/src/config.h
ff/src/types.hpp
ff/src/utk_platform_macros.hpp
ff/src/Array.hpp
ff/src/FSInfo.hpp
ff/src/Error.cpp
ff/src/MMapFileMapping.hpp
ff/src/utk_file_resize_win32.hpp
ff/src/ff.cpp
ff/src/r_ff.h
ff/src/utk_file_resize.hpp
ff/src/utk_file_resize.cpp
ff/src/utk_file_allocate_fseek.cpp
ff/src/ff.h
ff/src/FSInfo_win32.cpp
ff/src/Win32FileMapping.hpp
ff/src/FSInfo_statfs.cpp
ff/src/r_ff_makevmodes.h
ff/src/r_ff_methoddeclaration.h
ff/src/ordermerge.c
ff/src/r_file_resize.cpp
ff/NAMESPACE
ff/NEWS
ff/R
ff/R/fileutil.R
ff/R/ffcsv.R
ff/R/ffsave.R
ff/R/ffapply.R
ff/R/ffreturn.R
ff/R/generics.R
ff/R/getpagesize.R
ff/R/ffbit.R
ff/R/as.ff.R
ff/R/ffdf.R
ff/R/ordermerge.R
ff/R/bigsample.R
ff/R/fileresize.R
ff/R/CFUN.R
ff/R/array.R
ff/R/vt.R
ff/R/fffactor.R
ff/R/util.R
ff/R/vmode.R
ff/R/hi.R
ff/R/zzz.R
ff/R/ff.R
ff/MD5
ff/DESCRIPTION
ff/configure
ff/man
ff/man/vector.vmode.rd
ff/man/is.open.rd
ff/man/close.ff.rd
ff/man/ff.rd
ff/man/ffindexget.rd
ff/man/hiparse.rd
ff/man/splitPathFile.rd
ff/man/hi.rd
ff/man/array2vector.rd
ff/man/fixdiag.rd
ff/man/symmetric.rd
ff/man/as.ff.rd
ff/man/sortLevels.rd
ff/man/Extract.ff.rd
ff/man/ffxtensions.rd
ff/man/as.integer.hi.rd
ff/man/as.vmode.rd
ff/man/physical.ff.rd
ff/man/Internal_ffdf.rd
ff/man/ffdf.rd
ff/man/vmode.rd
ff/man/finalizer.rd
ff/man/geterror.ff.rd
ff/man/ffsave.rd
ff/man/ffconform.rd
ff/man/getpagesize.rd
ff/man/ffinfo.rd
ff/man/regtest.fforder.rd
ff/man/ffsort.rd
ff/man/dimorderCompatible.rd
ff/man/ramattribs.rd
ff/man/length.hi.rd
ff/man/ffdfsort.rd
ff/man/as.ff.bit.rd
ff/man/print.ff.rd
ff/man/add.rd
ff/man/readwrite.ff.rd
ff/man/matprint.rd
ff/man/is.readonly.rd
ff/man/write.table.ffdf.rd
ff/man/ramorder.default.rd
ff/man/nrowAssign.rd
ff/man/dim.ff.rd
ff/man/length.ff.rd
ff/man/matcomb.rd
ff/man/CFUN.rd
ff/man/undim.rd
ff/man/vw.rd
ff/man/filename.rd
ff/man/names.ff.rd
ff/man/Extract.ffdf.rd
ff/man/chunk.bit.rd
ff/man/update.ff.rd
ff/man/is.ff.rd
ff/man/Forbidden_ffdf.rd
ff/man/vmode.ffdf.rd
ff/man/length.ffdf.rd
ff/man/vectorIndex2arrayIndex.rd
ff/man/physical.ffdf.rd
ff/man/chunk.ffdf.rd
ff/man/levels.ff.rd
ff/man/bigsample.rd
ff/man/swap.rd
ff/man/dummy.dimnames.rd
ff/man/ffdfindexget.rd
ff/man/is.sorted.rd
ff/man/maxlength.rd
ff/man/file.resize.rd
ff/man/vecprint.rd
ff/man/symmIndex2vectorIndex.rd
ff/man/na.count.rd
ff/man/ramsort.default.rd
ff/man/dimnames.ffdf.rd
ff/man/as.hi.rd
ff/man/pagesize.rd
ff/man/ffload.rd
ff/man/ffapply.rd
ff/man/finalize.rd
ff/man/clone.rd
ff/man/mismatch.rd
ff/man/read.table.ffdf.rd
ff/man/delete.rd
ff/man/LimWarn.rd
ff/man/unsort.rd
ff/man/vt.rd
ff/man/arrayIndex2vectorIndex.rd
ff/man/ffdrop.rd
ff/man/getset.ff.rd
ff/man/open.ff.rd
ff/man/ffindexorder.rd
ff/man/is.ffdf.rd
ff/man/as.ffdf.rd
ff/man/ffsuitable.rd
ff/man/ram2ffcode.rd
ff/man/clone.ffdf.rd
ff/man/repnam.rd
ff/man/vector2array.rd
ff/man/maxffmode.rd
ff/man/dimnames.ff_array.rd
ff/man/unclass_-.rd
ff/man/ffreturn.rd
ff/man/fforder.rd
ff/LICENSE