Description Usage Arguments Value Examples
This method saves the function that's being called
1 2 3 4 5 6 7 8 9 10 11 |
fun |
function call name |
... |
parameters for function call |
seed |
when function call is random, this allows to set seed beforehand |
base.dir |
directory where data is stored |
cache.prefix |
prefix for file name to be generated from parameters (...) |
cache.digest |
cache of the digest for one or more of the parameters |
show.message |
show message that data is being retrieved from cache |
force.recalc |
force the recalculation of the values |
add.to.hash |
something to add to the filename generation |
the result of fun(...)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # [optional] save cache in a temporary directory
# otherwise it writes to the current directory
# to folder named run-cache
base.dir(tempdir())
#
run.cache(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
run.cache(c, 1, 2, 3, 4)
run.cache(c, 1, 2, 3, 4, cache.digest = list(digest.cache(1)))
run.cache(c, a=1, 2, c= 3, 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.