Title: | Simple R Cache |
---|---|
Description: | Simple result caching in R based on R.cache. The global environment is not considered when caching results simplifying moving files between multiple instances of R. Relies on more base functions than R.cache (e.g. cached results are saved using saveRDS() and readRDS()). |
Authors: | Augustin Luna, Vinodh Rajapakse |
Maintainer: | Augustin Luna <[email protected]> |
License: | LGPL |
Version: | 0.3.3 |
Built: | 2024-12-22 06:26:05 UTC |
Source: | CRAN |
Add Memoization to a Function
addMemoization(fcn, verbose = FALSE)
addMemoization(fcn, verbose = FALSE)
fcn |
the function to be memoized |
verbose |
show debugging information |
memoized function
runifCached <- addMemoization(runif)
runifCached <- addMemoization(runif)
Call a Memoized Function
memoizedCall(fcn, ...)
memoizedCall(fcn, ...)
fcn |
a function |
... |
the arguments to the function |
result of memoized function
If the environment variable DEBUG_SIMPLERCACHE is set, then the keyHash will be outputted. This can be used to identify cache RDS files.
Set Cache Root Path
setCacheRootPath(path = tempdir())
setCacheRootPath(path = tempdir())
path |
the cache root directory (DEFAULT: a temporary directory, but this can be change to a more permanent location) |
setCacheRootPath() ## Not run: setCacheRootPath("~/.simpleRCache") ## End(Not run)
setCacheRootPath() ## Not run: setCacheRootPath("~/.simpleRCache") ## End(Not run)