cache_object: Cache object

View source: R/cache_object.R

cache_objectR Documentation

Cache object

Description

Cache object

Usage

cache_object(expr, filename, renew = F, ...)

Arguments

expr

An expression

filename

A filename to use

renew

Whether to force renewal of the object

...

Other arguments passed to readr::write_rds()

Value

An object

Examples

i = cache_object(MASS::mvrnorm(1e6, rep(0, 3), matrix(c(1, .4, .4, .4, 1, .4, .4, .4, 1), ncol = 3)), "test_object.rds")
i = cache_object(stop("This is not evaluated"), "test_object.rds")
i = cache_object(warning("But this is"), "test_object.rds", renew = T)

Deleetdk/kirkegaard documentation built on April 22, 2024, 5:22 p.m.