| pip_add_from | R Documentation |
Copies one step from pipeline y into pipeline x, preserving its
function, parameters, tags, and dependency links.
pip_add_from(x, y, step)
x |
Target pipeflow pipeline object. |
y |
Source pipeflow pipeline object. |
step |
Step name to copy from |
The updated target pipeline, invisibly.
# Build a source pipeline with reusable steps
src <- pip_new("source") |>
pip_add("load", \(n = 3) seq_len(n)) |>
pip_add("square", \(x = ~load) x^2)
# Copy steps into a new pipeline one at a time.
# The dependency of "square" on "load" is re-established automatically.
dst <- pip_new("target")
pip_add_from(dst, src, "load")
pip_add_from(dst, src, "square")
pip_run(dst)
pip_collect_out(dst)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.