Learn R Programming

drake (version 4.2.0)

cached: Function cached

Description

Check whether targets are in the cache. If no targets are specified with ... or list, then cached() lists all the items in the drake cache. Read/load a cached item with readd() or loadd().

Usage

cached(..., list = character(0), no_imported_objects = FALSE,
  path = getwd(), search = TRUE, cache = NULL)

Arguments

...

objects to load from the cache, as names (unquoted) or character strings (quoted). Similar to ... in remove(...).

list

character vector naming objects to be loaded from the cache. Similar to the list argument of remove().

no_imported_objects

logical, applies only when no targets are specified and a list of cached targets is returned. If no_imported_objects is TRUE, then cached() shows built targets (with commands) plus imported files, ignoring imported objects. Otherwise, the full collection of all cached objects will be listed. Since all your functions and all their global variables are imported, the full list of imported objects could get really cumbersome.

path

Root directory of the drake project, or if search is TRUE, either the project root or a subdirectory of the project. Ignored if a cache is supplied.

search

logical. If TRUE, search parent directories to find the nearest drake cache. Otherwise, look in the current working directory only. Ignored if a cache is supplied.

cache

drake cache. See new_cache(). If supplied, path and search are ignored.

Value

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

See Also

built, imported, readd, loadd, plan, make

Examples

Run this code
# NOT RUN {
load_basic_example()
make(my_plan)
cached(list = 'reg1')
cached(no_imported_objects = TRUE)
cached()
# }

Run the code above in your browser using DataLab