Learn R Programming

filehash (version 2.4-5)

filehashRDS-class: Filehash RDS Class

Description

An implementation of filehash databases using diretories and separate files

Usage

# S4 method for filehashRDS,character
dbInsert(db, key, value, safe = TRUE, ...)

# S4 method for filehashRDS,character dbFetch(db, key, ...)

# S4 method for filehashRDS,character dbMultiFetch(db, key, ...)

# S4 method for filehashRDS,character dbExists(db, key, ...)

# S4 method for filehashRDS dbList(db, ...)

# S4 method for filehashRDS,character dbDelete(db, key, ...)

# S4 method for filehashRDS dbUnlink(db, ...)

Arguments

db

a filehashRDS object

key

character, the name of an R object

value

an R object

safe

Should the operation be done safely?

...

arguments passed to other methods

Methods (by generic)

  • dbInsert(db = filehashRDS, key = character): Insert an R object into a filehashRDS database

  • dbFetch(db = filehashRDS, key = character): Retrieve a value from a filehashRDS database

  • dbMultiFetch(db = filehashRDS, key = character): Retrieve multiple objects from a filehashRDS database

  • dbExists(db = filehashRDS, key = character): Determine if a key exists in a filehashRDS database

  • dbList(filehashRDS): Return a character vector of all key stored in a database

  • dbDelete(db = filehashRDS, key = character): Delete a key and its corresponding object from a filehashRDS database

  • dbUnlink(filehashRDS): Delete an entire filehashRDS database

Slots

dir

Directory where files are stored (filehashRDS only)

Details

When safe = TRUE in dbInsert, objects are written to a temp file before replacing any existing objects. This way, if the operation is interrupted, the original data are not corrupted.

For dbMultiFetch, key is a character vector of keys.