Description Usage Arguments Details Examples
'xache' works as follows:
1 2 |
symbol |
A string representing the variable that holds the results. |
file |
A path towards a RData file from which to load and to which to #' save the contents of the above variable. |
init |
A function that will generate the contents if it does not already exist. |
... |
Arguments to pass to the init function. |
verbose |
Whether to print debug messages to screen. Defaults to FALSE. |
force |
Whether to force recomputation. Defaults to FALSE. |
envir |
The environment in which to look for, and if it does not already exist, to create the variable of interest. |
1. If the specified variable exists, nothing happens because there is no need to recompute its contents. 2. If it the variable does not exist, 'xache' will attempt to load it from the specified RData file. 3. If the RData file does not exist, the specified function will evaluate the specified function, and store its results in the specified variable as well as in the RData file.
1 2 3 4 | xache("test", "test.RData", function () {
# do some calculation
2 * 2 # dummy result
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.