View source: R/helper-load_or_create.R
load_or_create | R Documentation |
Load a file from a cache directory, or create and save it
load_or_create(f, name, recreate = FALSE, cache_dir = "cache")
f |
function to call when the file does not exist. |
name |
name of cache file (including .rds). |
recreate |
if TRUE, recreate the file even if it exists. |
cache_dir |
directory that contains cache files. It is created if it does not exist. |
object created by function f, or stored in cache file
## Not run:
load_or_create(function() {
rnorm(10000)
}, "rnorm-results.rds", recreate=FALSE, cache_dir="cache")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.