Learn R Programming

drake (version 7.5.2)

deps_profile: Find out why a target is out of date.

Description

The dependency profile can give you a hint as to why a target is out of date. It can tell you if

  • the command changed (deps_profile() reports the hash of the command, not the command itself)

  • at least one input file changed,

  • at least one output file changed,

  • or a non-file dependency changed. For this last part, the imports need to be up to date in the cache, which you can do with outdated() or make(skip_targets = TRUE).

  • the pseudo-random number generator seed changed. Unfortunately, deps_profile() does not currently get more specific than that.

Usage

deps_profile(target, config, character_only = FALSE)

Arguments

target

Name of the target.

config

Configuration list output by drake_config() or make().

character_only

Logical, whether to assume target is a character string rather than a symbol.

Value

A data frame of old and new values for each of the main triggers, along with an indication of which values changed since the last make().

See Also

diagnose(), deps_code(), make(), drake_config()

Examples

Run this code
# NOT RUN {
isolate_example("Quarantine side effects.", {
if (suppressWarnings(require("knitr"))) {
load_mtcars_example() # Load drake's canonical example.
make(my_plan) # Run the project, build the targets.
config <- drake_config(my_plan)
# Get some example dependency profiles of targets.
deps_profile(small, config = config)
# Change a dependency.
simulate <- function(x) {}
# Update the in-memory imports in the cache
# so deps_profile can detect changes to them.
# Changes to targets are already cached.
make(my_plan, skip_targets = TRUE)
# The dependency hash changed.
deps_profile(small, config = config)
}
})
# }

Run the code above in your browser using DataLab