- target
If character_only
is TRUE
, then
target
is a character string naming the object to read.
Otherwise, target
is an unquoted symbol with the name of the
object.
- character_only
Logical, whether name
should be treated
as a character or a symbol
(just like character.only
in library()
).
- path
Path to a drake
cache
(usually a hidden .drake/
folder) or NULL
.
- search
Deprecated.
- cache
drake cache. See new_cache()
.
If supplied, path
is ignored.
- namespace
Optional character string,
name of the storr
namespace to read from.
- verbose
Deprecated on 2019-09-11.
- show_source
Logical, option to show the command
that produced the target or indicate that the object
was imported (using show_source()
).
- subtargets
A numeric vector of indices.
If target
is dynamic, loadd()
and readd()
retrieve
a list of sub-targets. You can restrict which sub-targets
to retrieve with the subtargets
argument. For example,
readd(x, subtargets = seq_len(3))
only retrieves the
first 3 sub-targets of dynamic target x
.
- subtarget_list
Logical, for dynamic targets only.
If TRUE
, the dynamic target is loaded as a named
list of sub-target values. If FALSE
, drake
attempts to concatenate the sub-targets with vctrs::vec_c()
(and returns an unnamed list if such concatenation is not possible).
- ...
Targets to load from the cache: as names (symbols) or
character strings. If the tidyselect
package is installed,
you can also supply dplyr
-style tidyselect
commands such as starts_with()
, ends_with()
, and one_of()
.
- list
Character vector naming targets to be loaded from the
cache. Similar to the list
argument of remove()
.
- imported_only
Logical, deprecated.
- envir
Environment to load objects into. Defaults to the
calling environment (current workspace).
- jobs
Number of parallel jobs for loading objects. On
non-Windows systems, the loading process for multiple objects
can be lightly parallelized via parallel::mclapply()
.
just set jobs to be an integer greater than 1. On Windows,
jobs
is automatically demoted to 1.
- deps
Logical, whether to load any cached
dependencies of the targets
instead of the targets themselves.
Important note:
deps = TRUE
disables tidyselect
functionality. For example,
loadd(starts_with("model_"), config = config, deps = TRUE)
does not work. For the selection mechanism to work,
the model_*
targets to need to already be in the cache,
which is not always the case when you are debugging your projects.
To help drake
understand what you mean,
you must name the targets explicitly when deps
is TRUE
, e.g.
loadd(model_A, model_B, config = config, deps = TRUE)
.
- lazy
Either a string or a logical. Choices:
"eager"
: no lazy loading. The target is loaded right away
with assign()
.
"promise"
: lazy loading with delayedAssign()
"bind"
: lazy loading with active bindings:
bindr::populate_env()
.
TRUE
: same as "promise"
.
FALSE
: same as "eager"
.
- graph
Deprecated.
- replace
Logical. If FALSE
,
items already in your environment
will not be replaced.
- tidyselect
Logical, whether to enable
tidyselect
expressions in ...
like
starts_with("prefix")
and ends_with("suffix")
.
- config
Optional drake_config()
object.
You should supply one if deps
is TRUE
.