Package 'simpleRCache'

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

Help Index


Add Memoization to a Function

Description

Add Memoization to a Function

Usage

addMemoization(fcn, verbose = FALSE)

Arguments

fcn

the function to be memoized

verbose

show debugging information

Value

memoized function

Examples

runifCached <- addMemoization(runif)

Call a Memoized Function

Description

Call a Memoized Function

Usage

memoizedCall(fcn, ...)

Arguments

fcn

a function

...

the arguments to the function

Value

result of memoized function

Note

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

Description

Set Cache Root Path

Usage

setCacheRootPath(path = tempdir())

Arguments

path

the cache root directory (DEFAULT: a temporary directory, but this can be change to a more permanent location)

Examples

setCacheRootPath()
## Not run: 
setCacheRootPath("~/.simpleRCache")

## End(Not run)