Replaces a step's function while keeping it in the same position in the
pipeline. Downstream steps are automatically marked as outdated and will
re-run on the next pip_run().
Usage
pip_replace(x, step, fun, group = step, tags = character(0))Examples
p <- pip_new() |>
pip_add("load", \(n = 5) seq_len(n)) |>
pip_add("double", \(x = ~load) x * 2)
pip_run(p)
#> info [2026-06-07 15:34:09.317 UTC]: Start run of pipeflow_pip 'pipe'
#> info [2026-06-07 15:34:09.318 UTC]: Step 1/2 load
#> info [2026-06-07 15:34:09.318 UTC]: Step 2/2 double
#> info [2026-06-07 15:34:09.320 UTC]: Finished run of pipeflow_pip 'pipe'
p
#> <pipeflow_pip> pipe (2 steps)
#> -----------------------------
#> step depends out state
#> 1: load 1,2,3,4,5 done
#> 2: double load 2, 4, 6, 8,10 done
# Replace "load" — downstream steps are automatically marked "outdated"
pip_replace(p, "load", \(n = 3) seq_len(n))
p
#> <pipeflow_pip> pipe (2 steps)
#> -----------------------------
#> step depends out state
#> 1: load [NULL] new
#> 2: double load 2, 4, 6, 8,10 outdated
# Re-run to bring everything up to date
pip_run(p)
#> info [2026-06-07 15:34:09.330 UTC]: Start run of pipeflow_pip 'pipe'
#> info [2026-06-07 15:34:09.330 UTC]: Step 1/2 load
#> info [2026-06-07 15:34:09.331 UTC]: Step 2/2 double
#> info [2026-06-07 15:34:09.332 UTC]: Finished run of pipeflow_pip 'pipe'
p
#> <pipeflow_pip> pipe (2 steps)
#> -----------------------------
#> step depends out state
#> 1: load 1,2,3 done
#> 2: double load 2,4,6 done
