cachedCall: Make a cached function call

Description Usage Arguments Value

View source: R/core_public.R

Description

This function wrapper both returns a CachedResult and can absorb previous CachedResult(s) as arguments to the wrapped function.

Usage

1
cachedCall(..fun.., ...)

Arguments

..fun..

The wrapped function whose return value is to be cached. This should be a pure (side-effects free) function that always returns the same result value given the same arguments i.e. should be idempotent (see https://en.wikipedia.org/wiki/Pure_function) such as e.g. algebraic functions mean or sum.

...

Arguments to be passed to ..fun... These can be normal R objects or the results of the previous cachedCall steps.

Value

CachedResult S3 object whose value can be extracted with function extractVal. A CachedResult needs to be wrapped by extractVal if it is used outside cachedCall as an argument in other functions.


alekrutkowski/cacheflow documentation built on Sept. 3, 2021, 7:10 p.m.