freeze: Assign value to variable if it is not cached

Description Usage Arguments Details Value Examples

View source: R/freeze.R

Description

Assign value to variable if the value is not cached

Usage

1
freeze(object, expression)

Arguments

object

a string given the name of the variable to be assigned to

expression

the expression evaluating into the value to be assigned

Details

For saving time, objects can be cached under their object name with the ".rda" extension in a cache directory "/cache" under the current working directory. If a cached version of the variable exists, do not recalculate the assigned part of the expression, but rather use the cache. This differs from memoization as a permanently cached version is used.

Value

nothing, invoked for side effects (assigning a value to a variable)

Examples

1
## Not run: freeze("a_big_sum", sum(1:1020))

cszang/fridge documentation built on May 14, 2019, 12:26 p.m.