Creates a new workflow plan data frame with a single new target. This new target is a list, vector, or other aggregate of a collection of existing targets in another workflow plan data frame.

gather_plan(plan = NULL, target = "target", gather = "list")

Arguments

plan

workflow plan data frame of prespecified targets

target

name of the new aggregated target

gather

function used to gather the targets. Should be one of list(...), c(...), rbind(...), or similar.

Value

A workflow plan data frame that aggregates multiple prespecified targets into one additional target downstream.

Examples

# Workflow plan for datasets: datasets <- drake_plan( small = simulate(5), large = simulate(50)) # Create a new target that brings the datasets together. gather_plan(datasets, target = "my_datasets")
#> # A tibble: 1 x 2 #> target command #> <chr> <chr> #> 1 my_datasets list(small = small, large = large)
# This time, the new target just appends the rows of 'small' and 'large' # into a single matrix or data frame. gathered <- gather_plan( datasets, target = "aggregated_data", gather = "rbind" ) gathered
#> # A tibble: 1 x 2 #> target command #> <chr> <chr> #> 1 aggregated_data rbind(small = small, large = large)
# For the complete workflow plan, row bind the pieces together. my_plan <- rbind(datasets, gathered) my_plan
#> # A tibble: 3 x 2 #> target command #> <chr> <chr> #> 1 small simulate(5) #> 2 large simulate(50) #> 3 aggregated_data rbind(small = small, large = large)