Last chance! 50% off unlimited learning
Sale ends in
Only shows the most upstream updated targets.
Whether downstream targets are recoverable depends on
the eventual values of the upstream targets in the next make()
.
recoverable(config, make_imports = TRUE, do_prework = TRUE)
Optional internal runtime parameter list
produced with drake_config()
.
You must use a fresh config
argument with an up-to-date
dependency graph that was never modified by hand.
If needed, rerun drake_config()
early and often.
See the details in the help file for drake_config()
.
Logical, whether to make the imports first.
Set to FALSE
to save some time and risk obsolete output.
Whether to do the prework
normally supplied to make()
.
Character vector of the names of recoverable targets.
make(recover = TRUE, recoverable = TRUE)
powers automated data recovery.
The default of recover
is FALSE
because
Automated data recovery is still experimental.
It has reproducibility issues. Targets recovered from the distant past may have been generated with earlier versions of R and earlier package environments that no longer exist.
How it works: if recover
is TRUE
,
drake
tries to salvage old target values from the cache
instead of running commands from the plan.
A target is recoverable if
There is an old value somewhere in the cache that shares the command, dependencies, etc. of the target about to be built.
The old value was generated with make(recoverable = TRUE)
.
If both conditions are met, drake
will
Assign the most recently-generated admissible data to the target, and
skip the target's command.
r_recoverable()
, r_outdated()
, drake_config()
, missed()
,
drake_plan()
, make()
# NOT RUN {
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Get the code with drake_example("mtcars").
config <- drake_config(my_plan)
make(my_plan)
clean()
outdated(config) # Which targets are outdated?
recoverable(config) # Which of these are recoverable and upstream?
# The report still builds because clean() removes report.md,
# but make() recovers the rest.
make(my_plan, recover = TRUE)
# When was the *recovered* small data actually built (first stored)?
# (Was I using a different version of R back then?)
diagnose(small)$date
# If you set the same seed as before, you can even
# rename targets without having to build them again.
# For an example, see
# https://github.com/ropensci/drake/blob/master/README.md#automatic-recovery-and-renaming. # nolint
}
})
# }
Run the code above in your browser using DataLab