Learn R Programming

pipeflow (version 0.2.2)

pipe_insert_after: Insert step

Description

Insert step

Usage

pipe_insert_after(pip, afterStep, step, ...)

pipe_insert_before(pip, beforeStep, step, ...)

Value

returns the Pipeline object invisibly

Arguments

pip

Pipeline object

afterStep

string name of step after which to insert

step

string name of step to insert

...

further arguments passed to pipe_add()

beforeStep

string name of step before which to insert

Methods

  • pipe_insert_after: insert step after a certain step of the pipeline

  • pipe_insert_before: insert step before a certain step of the pipeline

Examples

Run this code
# pipe_insert_after
p <- pipe_new("pipe", data = 1)
pipe_add(p, "f1", \(x = 1) x)
pipe_add(p, "f2", \(x = ~f1) x)
pipe_insert_after(p, "f1", step = "after_f1", \(x = ~f1) x)
p

# insert_before
pipe_insert_before(p, "f2", step = "before_f2", \(x = ~f1) 2 * x)
p

Run the code above in your browser using DataLab