cache: Cache R objects on disk

Description Usage Arguments Details Value

Description

Store and retrieve results of arbitrary R expressions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
cache(expr, key, verbose = getOption("verbose"), force = FALSE)

cache_get(
  ...,
  root = cache_root(),
  ext = c(".rds", ".fst", ".feather", ".rds.lz4", ".rds.snz"),
  verbose = getOption("verbose")
)

cache_put(
  obj,
  ...,
  root = cache_root(),
  ext = c(".rds", ".fst", ".feather", ".rds.lz4", ".rds.snz"),
  verbose = getOption("verbose")
)

Arguments

expr

expression

key

character (filename will be equal to key appended with ext)

verbose

display messages

force

ignore whether an object may already be cached

obj

object

compress

as in readr::read_rds()

Details

If ext is ".fst" or ".feather", then the returned value will be tabular data. If ext is ".rds", then it can be any kind of object.

Value

object (see Details)


BAAQMD/cacher documentation built on May 20, 2020, 12:44 a.m.