Learn R Programming

drake (version 5.0.0)

parallel_stages: Show how make() will build your targets in successive parallelizable stages.

Description

The stages determine the order in which make() builds the targets.

Usage

parallel_stages(config, from_scratch = FALSE)

Arguments

config

An configuration list output by make() or drake_config().

from_scratch

logical, whether to assume that the next make() will run from scratch so that all targets are attempted.

Value

A data frame of information spelling out how targets are divided into parallelizable stages (according to the stage column).

Details

Usually, make() divides the targets and imports into parallelizable stages strictly according to the columns in vis_drake_graph(). However, if some targets are out of date, drake looks ahead in the graph until it finds outdated targets for the current stage. The parallel_stages() function takes this behavior into account when it reports a data frame of information on how targets and imports will be divided into parallel stages during the next make().

See Also

next_stage, make, make_with_config

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_basic_example() # Get the code with drake_example("basic").
config <- drake_config(my_plan) # Get a configuration list.
# Parallel stages for the next make().
parallel_stages(config = config)
# Check the graph to see that the information agrees.
vis_drake_graph(config = config)
# Build the project.
config <- make_with_config(config) # or make(my_plan)
# Nothing to build in the next make().
parallel_stages(config = config)
# Change a dependency and notice how the stages change.
reg2 = function(d){
  d$x3 = d$x^3
  lm(y ~ x3, data = d)
}
parallel_stages(config = config)
})
# }

Run the code above in your browser using DataLab