Learn R Programming

drake (version 5.2.1)

plan_analyses: Generate a workflow plan data frame to analyze multiple datasets using multiple methods of analysis.

Description

Uses wildcards to create a new workflow plan data frame from a template data frame.

Usage

plan_analyses(plan, datasets)

Arguments

plan

workflow plan data frame of analysis methods. The commands in the command column must have the dataset__ wildcard where the datasets go. For example, one command could be lm(dataset__). Then, the commands in the output will include lm(your_dataset_1), lm(your_dataset_2), etc.

datasets

workflow plan data frame with instructions to make the datasets.

Value

An evaluated workflow plan data frame of analysis targets.

See Also

plan_summaries(), make(), drake_plan()

Examples

Run this code
# NOT RUN {
# Create the piece of the workflow plan for the datasets.
datasets <- drake_plan(
  small = simulate(5),
  large = simulate(50))
# Create a template for the analysis methods.
methods <- drake_plan(
  regression1 = reg1(dataset__),
  regression2 = reg2(dataset__))
# Evaluate the wildcards to create the part of the workflow plan
# encoding the analyses of the datasets.
ans <- plan_analyses(methods, datasets = datasets)
ans
# For the final workflow plan, row bind the pieces together.
my_plan <- rbind(datasets, ans)
my_plan
# }

Run the code above in your browser using DataLab