drake (version 6.2.1)

expand_plan: Create replicates of targets.

Description

Duplicates the rows of a workflow plan data frame. Prefixes are appended to the new target names so targets still have unique names.

Usage

expand_plan(plan, values = NULL, rename = TRUE, sep = "_")

Arguments

plan

workflow plan data frame

values

values to expand over. These will be appended to the names of the new targets.

rename

logical, whether to rename the targets based on the values. See the examples for a demo.

sep

character scalar, delimiter between the original target names and the values to append to create the new target names. Only relevant when rename is TRUE.

Value

An expanded workflow plan data frame (with replicated targets).

See Also

drake_plan(), map_plan(), reduce_by(), gather_by(), reduce_plan(), gather_plan(), evaluate_plan(), expand_plan()

Examples

Run this code
# NOT RUN {
# Create the part of the workflow plan for the datasets.
datasets <- drake_plan(
  small = simulate(5),
  large = simulate(50))
# Create replicates. If you want repeat targets,
# this is convenient.
expand_plan(datasets, values = c("rep1", "rep2", "rep3"))
# Choose whether to rename the targets based on the values.
expand_plan(datasets, values = 1:3, rename = TRUE)
expand_plan(datasets, values = 1:3, rename = FALSE)
# }

Run the code above in your browser using DataLab