Learn R Programming

pipeflow (version 0.2.2)

pipe_remove_step: Remove certain step from the pipeline.

Description

Can be used to remove any given step. If other steps depend on the step to be removed, an error is given and the removal is blocked, unless recursive was set to TRUE.

Usage

pipe_remove_step(pip, step, recursive = FALSE)

Value

the Pipeline object invisibly

Arguments

pip

Pipeline object

step

string the name of the step to be removed

recursive

logical if TRUE the step is removed together with all its downstream dependencies.

Examples

Run this code
p <- pipe_new("pipe", data = 1:2)
pipe_add(p, "add1", \(data = ~data, x = 1) x + data)
pipe_add(p, "add2", \(x = 1, y = ~add1) x + y)
pipe_add(p, "mult1", \(x = 1, y = ~add2) x * y)
p

pipe_remove_step(p, "mult1")
p

try(pipe_remove_step(p, "add1"))
pipe_remove_step(p, "add1", recursive = TRUE)
p

Run the code above in your browser using DataLab