Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

memoizedCall

Calls a function with memoization


Description

Calls a function with memoization, that is, caches the results to be retrieved if the function is called again with the exact same arguments.

Usage

## Default S3 method:
memoizedCall(what, ..., envir=parent.frame(), force=FALSE, sources=NULL, dirs=NULL)

Arguments

what

The function to be called, or a character string specifying the name of the function to be called, cf. do.call().

...

Arguments passed to the function.

envir

The environment in which the function is evaluated.

force

If TRUE, any cached results are ignored, otherwise not.

sources, dirs

Optional arguments passed to loadCache() and saveCache().

Details

If the function returns NULL, that particular function call is not memoized.

Value

Returns the result of the function call.

Author(s)

Henrik Bengtsson

See Also

Internally, loadCache() is used to load memoized results, if available. If not available, then do.call() is used to evaluate the function call, and saveCache() is used to save the results to cache.


R.cache

Fast and Light-Weight Caching (Memoization) of Objects and Results to Speed Up Computations

v0.15.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.