pipe_collect_out {pipeflow} | R Documentation |
Collect output from entire pipeline
Description
Collects output afer pipeline run, by default, from all
steps for which keepOut
was set to TRUE
when steps were added
(see pipe_add()
). The output is grouped by the group names (see
group
parameter in pipe_add()
),
which by default are set identical to the step names.
Usage
pipe_collect_out(pip, groupBy = "group", all = FALSE)
Arguments
pip |
|
groupBy |
|
all |
|
Value
list
containing the output, named after the groups, which,
by default, are the steps.
Examples
p <- pipe_new("pipe", data = 1:2)
pipe_add(p, "step1", \(x = ~data) x + 2)
pipe_add(p, "step2", \(x = ~step1) x + 2, keepOut = TRUE)
pipe_run(p)
pipe_collect_out(p)
pipe_collect_out(p, all = TRUE) |> str()
# Grouped output
p <- pipe_new("pipe", data = 1:2)
pipe_add(p, "step1", \(x = ~data) x + 2, group = "add")
pipe_add(p, "step2", \(x = ~step1, y = 2) x + y, group = "add")
pipe_add(p, "step3", \(x = ~data) x * 3, group = "mult")
pipe_add(p, "step4", \(x = ~data, y = 2) x * y, group = "mult")
p
pipe_run(p)
pipe_collect_out(p, all = TRUE) |> str()
# Grouped by state
pipe_set_params(p, list(y = 5))
p
pipe_collect_out(p, groupBy = "state", all = TRUE) |> str()
[Package pipeflow version 0.2.2 Index]