.runCache | R Documentation |
This method saves the function that's being called
.runCache(
fun,
...,
seed = NULL,
baseDir = NULL,
cachePrefix = "generic_cache",
cacheDigest = list(),
showMessage = NULL,
forceRecalc = FALSE,
addToHash = NULL
)
## S4 method for signature 'function'
.runCache(
fun,
...,
seed = NULL,
baseDir = NULL,
cachePrefix = "generic_cache",
cacheDigest = list(),
showMessage = NULL,
forceRecalc = FALSE,
addToHash = NULL
)
fun |
function call name |
... |
parameters for function call |
seed |
when function call is random, this allows to set seed beforehand |
baseDir |
directory where data is stored |
cachePrefix |
prefix for file name to be generated from parameters (...) |
cacheDigest |
cache of the digest for one or more of the parameters |
showMessage |
show message that data is being retrieved from cache |
forceRecalc |
force the recalculation of the values |
addToHash |
something to add to the filename generation |
the result of fun(...)
.runCache(`function`)
: accepts function as first argument and save cache
# [optional] save cache in a temporary directory
#
glmSparseNet:::.baseDir(tempdir())
glmSparseNet:::.runCache(c, 1, 2, 3, 4)
#
# next three should use the same cache
# note, the middle call should be a little faster as digest is not
# calculated
# for the first argument
glmSparseNet:::.runCache(c, 1, 2, 3, 4)
glmSparseNet:::.runCache(c, a = 1, 2, c = 3, 4)
# Using a local folder
# glmSparseNet:::.runCache(c, 1, 2, 3, 4, baseDir = "runcache")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.