addMemoization {R.cache} | R Documentation |
Creates a copy of an existing function such that its results are memoized
Description
Creates a copy of an existing function such that its results are memoized.
Usage
## Default S3 method:
addMemoization(fcn, envir=parent.frame(), ...)
Arguments
fcn |
A |
envir |
The |
... |
Additional arguments for controlling the memoization,
i.e. all arguments of |
Details
The new function is setup such that the the memoized call is done in the environment of the caller (the parent frame of the function).
If the function
returns NULL
, that particular function call is
not memoized.
Value
Returns a function
.
Author(s)
Henrik Bengtsson
See Also
The returned function utilized memoizedCall
() internally.
[Package R.cache version 0.16.0 Index]