| [.pipeflow_pip | R Documentation |
Returns a new pipeline containing selected steps and all required upstream dependencies.
Extracts values from a pipeline using one or two indices.
With a single string name, named fields such as "pipeline" or "name"
are returned first; anything else returns the matching step-table column.
With two indices (row, column), a single cell is extracted.
## S3 method for class 'pipeflow_pip'
x[i, ...]
## S3 method for class 'pipeflow_pip'
x[[i, j, ...]]
x |
A pipeflow pipeline object. |
i |
integer (row indices) or character vector (step names) of steps to select |
... |
not used |
j |
column names to select |
A new pipeflow pipeline object.
Extracted value(s), depending on i and j.
p <- pip_new() |>
pip_add("load", \(n = 5) seq_len(n)) |>
pip_add("square", \(x = ~load) x^2) |>
pip_add("total", \(x = ~square) sum(x))
# Select by step name — upstream deps are pulled in automatically.
# Selecting only "total" still includes "load" and "square".
sub <- p["total"]
sub[["pipeline"]][["step"]] # "load", "square", "total"
# Select a subset of steps by name vector
p[c("load", "square")][["pipeline"]][["step"]] # "load", "square"
# Select by integer row index
p[1:2][["pipeline"]][["step"]] # "load", "square"
p <- pip_new() |>
pip_add("load", \(x = 1) x) |>
pip_add("fit", \(x = ~load) x + 1)
# Access internal objects by name
p[["pipeline"]] # the full step table
p[["name"]] # "pipe"
# Shorthand column access (equivalent to p[["pipeline"]][["step"]])
p[["step"]]
# Two-index form: p[[row, column]] extracts a single cell
p[["fit", "depends"]] # "load"
p[[2, "state"]] # state of the second step
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.