Triggers of a target.
Usage
drake_triggers(
command = TRUE,
depend = TRUE,
file = TRUE,
seed = TRUE,
format = TRUE,
condition = FALSE,
change = NULL,
mode = c("whitelist", "blacklist", "condition")
)
Arguments
- command
Logical, whether to rebuild the target if the
drake_plan()
command changes.- depend
Logical, whether to rebuild if a non-file dependency changes.
- file
Logical, whether to rebuild the target if a
file_in()
/file_out()
/knitr_in()
file changes. Also applies to external data tracked withtarget(format = "file")
.- seed
Logical, whether to rebuild the target if the seed changes. Only makes a difference if you set a custom
seed
column in yourdrake_plan()
at some point in your workflow.- format
Logical, whether to rebuild the target if the choice of specialized data format changes: for example, if you use
target(format = "qs")
one instance andtarget(format = "fst")
the next. Seehttps://books.ropensci.org/drake/plans.html#special-data-formats-for-targets
# nolint for details on formats.- condition
R code (expression or language object) that returns a logical. The target will rebuild if the code evaluates to
TRUE
.- change
R code (expression or language object) that returns any value. The target will rebuild if that value is different from last time or not already cached.
- mode
A character scalar equal to
"whitelist"
(default) or"blacklist"
or"condition"
. With themode
argument, you can choose how thecondition
trigger factors into the decision to build or skip the target. Here are the options."whitelist"
(default): we rebuild the target whenevercondition
evaluates toTRUE
. Otherwise, we defer to the other triggers. This behavior is the same as the decision rule described in the "Details" section of this help file."blacklist"
: we skip the target whenevercondition
evaluates toFALSE
. Otherwise, we defer to the other triggers."condition"
: here, thecondition
trigger is the only decider, and we ignore all the other triggers. We rebuild target whenevercondition
evaluates toTRUE
and skip it whenevercondition
evaluates toFALSE
.