| pip_lock | R Documentation |
Locks or unlocks all steps of a pipeline, or a subset of steps defined by
a view. Locked steps are skipped during pip_run() and are protected
against modification from pip_set_params(), pip_tag() or
pip_untag(). Calling pip_unlock() removes the lock again.
pip_lock(x)
pip_unlock(x)
x |
A pipeflow pip or view. |
The updated pipeline or view, invisibly.
p <- pip_new() |>
pip_add("x", \(x = 1) x) |>
pip_add("y", \(y = 2) y) |>
pip_add("sum", \(x = 1, y = 2) x + y)
(pip_run(p))
p[["sum", "out"]] # 3
# Lock "sum" step via a view so it cannot be overwritten
pip_set_params(p, params = list(x = 10, y = 20))
p[["sum", "params"]] # x = 10, y = 20
pip_lock(p["sum", ])
(pip_run(p))
p[["sum", "out"]] # still 3
# Note that locking also prevents any parameter updates
pip_set_params(p, params = list(x = 100, y = 200))
p[["x", "params"]] # x = 100
p[["y", "params"]] # y = 200
p[["sum", "params"]] # still x = 10, y = 20
# Unlock everything to allow updates again
pip_unlock(p)
pip_set_params(p, params = list(x = 100, y = 200))
(pip_run(p))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.