Learn R Programming

drake (version 5.0.0)

readd: Read and return a drake target or import from the cache.

Description

Does not delete the item from the cache.

Usage

readd(target, character_only = FALSE, path = getwd(), search = TRUE,
  cache = drake::get_cache(path = path, search = search, verbose = verbose),
  namespace = NULL, verbose = TRUE)

Arguments

target

If character_only is TRUE, target is a character string naming the object to read. Otherwise, target is an unquoted symbol with the name of the object. Note: target could be the name of an imported object.

character_only

logical, whether name should be treated as a character or a symbol (just like character.only in library()).

path

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

search

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

cache

optional drake cache. See codenew_cache(). If cache is supplied, the path and search arguments are ignored.

namespace

character scalar, name of an optional storr namespace to read from.

verbose

whether to print console messages

Value

The cached value of the target.

See Also

loadd, cached, built, link{imported}, drake_plan, make

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_basic_example() # Get the code with drake_example("basic").
make(my_plan) # Run the project, build the targets.
readd(reg1) # Return imported object 'reg1' from the cache.
readd(small) # Return targets 'small' from the cache.
readd("large", character_only = TRUE) # Return 'large' from the cache.
# For external files, only the fingerprint/hash is stored.
readd("'report.md'")
})
# }

Run the code above in your browser using DataLab