powered by
Load a file from a cache directory, or create and save it
load_or_create(f, name, recreate = FALSE, cache_dir = "cache")
function to call when the file does not exist.
name of cache file (including .rds).
if TRUE, recreate the file even if it exists.
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") # }
Run the code above in your browser using DataLab