Skip to contents

Inserts a stage created by stage_def() into a flow. This allows complex stages to be defined once and reused across multiple flows.

Usage

add_stage(fl, def)

Arguments

fl

A parade_flow object.

def

A parade_stage_def object created by stage_def().

Value

The input flow with the stage added.

Examples

sq <- stage_def("sq",
  f = function(x) list(result = x^2),
  schema = returns(result = dbl())
)

grid <- data.frame(x = 1:3)
result <- flow(grid) |>
  add_stage(sq) |>
  collect(engine = "sequential")