Learn R Programming

drake (version 5.0.0)

get_cache: Get the drake cache, optionally searching up the file system.

Description

Only works if the cache is in a folder called .drake/.

Usage

get_cache(path = getwd(), search = TRUE, verbose = 1, force = FALSE,
  fetch_cache = NULL)

Arguments

path

file path to the folder containing the cache. Yes, this is the parent directory containing the cache, not the cache itself, and it assumes the cache is in the `.drake` folder. If you are looking for a different cache with a known folder different from `.drake`, use the this_cache() function.

search

logical, whether to search back in the file system for the cache.

verbose

logical, whether to print the location of the cache

force

logical, whether to load the cache despite any back compatibility issues with the running version of drake.

fetch_cache

character vector containing lines of code. The purpose of this code is to fetch the storr cache with a command like storr_rds() or storr_dbi(), but customized. This feature is experimental.

Value

A drake/storr cache in a folder called .drake/, if available. NULL otherwise.

See Also

this_cache, new_cache, recover_cache, config

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
clean(destroy = TRUE)
# No cache is available.
get_cache() # NULL
load_basic_example() # Get the code with drake_example("basic").
make(my_plan) # Run the project, build the targets.
x <- get_cache() # Now, there is a cache.
# List the objects readable from the cache with readd().
x$list() # Or x$list(namespace = x$default_namespace)
})
# }

Run the code above in your browser using DataLab