drake (version 6.2.1)

dependency_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

  • 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). Unfortunately, dependency_profile() does not currently get more specific than that.

Usage

dependency_profile(target, config = drake::read_drake_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 the old hashes and new hashes of the data frame, along with an indication of which hashes changed since the last make().

See Also

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

Examples

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

Run the code above in your browser using DataCamp Workspace