Simple Key-Value Database

Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retrieving, and deleting data from the database. Utilities are provided that allow 'filehash' databases to be treated much like environments and lists are already used in R. These utilities are provided to encourage interactive and exploratory analysis on large datasets. Three different file formats for representing the database are currently available and new formats can easily be incorporated by third parties for use in the 'filehash' framework.


Check the 'filehash' git repository for the latest updates on the package at

Version 1.0

  • The 'DB' format has been removed; users should use 'DB1' instead

  • Internals of 'DB1' format have changed so that it should be a bit more reliable but perhaps a little slower

  • The 'dbDisconnect' generic has been removed since it is no longer necessary for the 'DB1' format (as it was before). It was never needed for the 'RDS' format and one never existed for that format.

Version 0.9

  • For 'filehashRDS' class, the 'dbDir' slot has been renamed to 'dir'.

  • An attempt has been made to normalize the error handling to make it consistent.

  • The various 'dump' functions have been given a 'type' argument

Version 0.8

  • Added function dbLazyLoad for lazy loading filehash databases.

  • dbCreate and dbInit are now generics with a method for character vectors. The behavior should be the same as before, by default.

  • dbLoad is generic.

  • The second argument to dbMultiFetch is 'key', not 'keys'.

  • dbInitialize is deprecated

  • 'DB1' and 'RDS' formats use normalizePath() for resolving paths to directories

  • There is a vignette now [via vignette("filehash")]

Version 0.6-3

  • Added methods for "[[", "$", "[[<-", and "$<-" for filehash objects. Only character indices are allowed

  • filehash-DB functions use the new serialize() from R 2.4.0 so that numeric data will not suffer from rounding error due to previous use of serialize(ascii = TRUE).

  • New format filehash-DB1 which stores the key index/map and data in a single file.

  • New "filehash" method for lapply so that functions can be applied to database entries.

Version 0.4-1

  • Patch release, changed some internals for the "DB" type databases

  • Added test database for regression testing in future releases

Version 0.4

  • Added name mangling scheme to prevent clobbering on case-insensitive OSes like Windows (thanks to Bill Venables and David Brahm)

  • Added dumpImage, dumpObjects, dumpDF functions for dumping various things to filehash databases

  • Added filehashOption() function for setting global options; right now only the default database type can be set

  • dbLoad and db2env are regular functions now rather than generics/methods. dbLoad's default 'env' is the parent frame now

  • Added a "filehash" method for 'with'

  • Added new generic dbUnlink which deletes a database from the disk

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


2.4-2 by Roger D. Peng, 3 years ago

Browse source code at

Authors: Roger D. Peng <[email protected]>

Documentation:   PDF Manual  

GPL (>= 2) license

Depends on methods

Imported by adehabitatMA, autoFRK, nat, tikzDevice, zooimage.

Depended on by filehashSQLite.

Suggested by tm.

See at CRAN