R/cache_ui.R
Read/load a cached item with readd()
or loadd()
.
cached(..., list = character(0), no_imported_objects = FALSE, path = getwd(), search = TRUE, cache = NULL, verbose = drake::default_verbose(), namespace = NULL, jobs = 1)
... | objects to load from the cache, as names (unquoted)
or character strings (quoted). Similar to |
---|---|
list | character vector naming objects to be loaded from the
cache. Similar to the |
no_imported_objects | logical, applies only when
no targets are specified and a list of cached targets is returned.
If |
path | Root directory of the drake project,
or if |
search | logical. If |
cache | drake cache. See |
verbose | logical or numeric, control printing to the console.
Use
|
namespace | character scalar, name of the storr namespace to use for listing objects |
jobs | number of jobs/workers for parallel processing |
Either a named logical indicating whether the given targets or cached or a character vector listing all cached items, depending on whether any targets are specified
built()
, imported()
,
readd()
, loadd()
,
drake_plan()
, make()
# NOT RUN { test_with_dir("Quarantine side effects.", { load_basic_example() # Load drake's canonical example. make(my_plan) # Run the project, build all the targets. cached(list = 'reg1') # Is 'reg1' in the cache? # List all the targets and imported files in the cache. # Exclude R objects imported from your workspace. cached(no_imported_objects = TRUE) # List all targets and imports in the cache. cached() # Clean the main data. clean() # The targets and imports are gone. cached() # But there is still metadata. build_times() cached(namespace = "build_times") # Clear that too. clean(purge = TRUE) cached(namespace = "build_times") build_times() }) # }