Memory-Efficient Storage of Large Data on Disk and Fast Access Functions
Overview
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.
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-30
- NOTE10 OK, 3 NOTE2026-07-25
- ERROR9 NOTE, 4 ERROR2026-07-11
Show 3 earlier changesHide 3 earlier changes
- NOTE13 NOTE2026-06-09
- ERROR12 NOTE, 1 ERROR2026-06-08
- NOTE2 OK, 12 NOTE2026-03-10
Documentation
- Help pages
- 101 (2 internal)
- Examples that run
- 98%88 run in a plain check · 2 never run
- Exported functions with examples
- 89%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 2%
Downloads
Repository
- PRs merged (all time)
- 60%
- Median days to close, 50 most recently updated closed issues
- 107
- Median days to close, 50 most recently updated closed PRs
- 24
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/truecluster/ff on 2026-10-18.
Dependencies
Installing ff adds 1 package (1 with compiled code, 297 KB of source tarballs). Heaviest: bit 297 KB.
Code & Tests
People & History
Maintainer since 2.1-0 (2008), previously Daniel Adler (1.0-1)
Show 3 peopleHide 3 people
Pick two releases to compare their code metrics.
- 4.5.3Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 4.5.22025-01-13 · diff ↗
- 4.5.02024-09-20 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 4.0.12
- RR 4.3.0 released · 2023-04-21
- 4.0.92023-01-25 · diff ↗
- 4.0.72022-05-06 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 4.0.52021-10-29 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 4.0.42020-10-13 · diff ↗
- 4.0.22020-07-30 · diff ↗ ·
added 166 exports
clone.ff, clone.ffdf, as.hi, pattern, pattern<-, filename, filename<-, pagesize, is.open, is.readonly, vmode, as.vmode, vmode<-, finalizer, finalizer<-, finalize, delete, deleteIfOpen, as.ff, as.ram, dimorder, dimorder<-, vw, vw<-, is.factor, is.ordered, ramclass, ramattribs, recodeLevels, sortLevels and 136 more - RR 4.0.0 released · 2020-04-24
Show 38 earlier eventsHide 38 earlier events
- 2.2-14.22020-04-16 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 2.2-142018-05-15 · diff ↗
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 2.2-132014-04-09 · diff ↗
- 2.2-122013-10-16 · diff ↗
- RR 3.0.0 released · 2013-04-03
- 2.2-112013-03-12 · diff ↗
- 2.2-102012-11-06 · diff ↗
- 2.2-92012-10-24 · diff ↗
- 2.2-72012-05-08 · diff ↗
- 2.2-62012-03-31 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.2-52012-01-27 · diff ↗
- 2.2-42012-01-15 · diff ↗
- RR 2.14.0 released · 2011-10-31
- 2.2-32011-07-25 · diff ↗
- 2.2-22011-04-24 · diff ↗
- RR 2.13.0 released · 2011-04-13
- RR 2.12.0 released · 2010-10-15
- 2.2-12010-10-05 · diff ↗
- 2.2-02010-09-30 · diff ↗
- RR 2.11.0 released · 2010-04-22
- 2.1-22010-01-20 · diff ↗
- 2.1-12009-11-05 · diff ↗
- 2.1-02009-11-03 · diff ↗
- RR 2.10.0 released · 2009-10-26
- RR 2.9.0 released · 2009-04-17
- 2.0.12009-04-16 · diff ↗
- RR 2.8.0 released · 2008-10-20
- 2.0.02008-08-03 · diff ↗ ·
removed 8 exports
getpagesize, getdefaultpagesize, ff, ffm, ffm.data.frame, seqpack, runique, sample - RR 2.7.0 released · 2008-04-22
- 1.0-12007-11-03
- RR 2.6.0 released · 2007-10-03
Package metadata
- First published
- 2007-11-03
- Total releases
- 30 / 19 yrs
- License
- GPL-2 | GPL-3 | file LICENSE OSI
- Minimum R
- ≥ 3.4.0
- Download size
- 321 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ff")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.