R/cache.R
This function does not apply to
in-memory caches such as storr_environment()
.
this_cache(path = drake::default_cache_path(), force = FALSE, verbose = drake::default_verbose(), fetch_cache = NULL)
path | file path of the cache |
---|---|
force | logical, whether to load the cache despite any back compatibility issues with the running version of drake. |
verbose | logical or numeric, control printing to the console.
Use
|
fetch_cache | character vector containing lines of code.
The purpose of this code is to fetch the |
A drake/storr cache at the specified path, if it exists.
# NOT RUN { test_with_dir("Quarantine side effects.", { clean(destroy = TRUE) try(x <- this_cache(), silent = FALSE) # The cache does not exist yet. load_basic_example() # Get the code with drake_example("basic"). make(my_plan) # Run the project, build the targets. y <- this_cache() # Now, there is a cache. z <- this_cache(".drake") # Same as above. manual <- new_cache("manual_cache") # Make a new cache. manual2 <- get_cache("manual_cache") # Get the new cache. }) # }