read_or_update_local_cache: Read the cached result of an expression from a locally cached...

Description Usage Arguments Value Note Examples

Description

Read the cached result of an expression from a locally cached file if it exists, else evaluate the expression, cache it, and return result.

Usage

1
read_or_update_local_cache(expression, local_cache_path, object_name)

Arguments

expression

The expression to be evaluated and returned if the cached result does not exist.

local_cache_path

The path that stores the cached objects. If NULL, no caching is performed.

object_name

The name of the object used to read/create the cache file.

Value

The result of evaluating the expression, either read from cache or from actually evaluating it.

Note

If evaluating the expression has side-effects, they will not happen if the result is returned from cache.

Examples

1
2
3
4
## Not run: 
read_or_update_local_cache(2+2, tempdir(), "TwoPlusTwo")

## End(Not run)

chambm/customProDB documentation built on May 31, 2019, 12:08 p.m.