Change the keepOut
flag at a given pipeline step,
which determines whether the output of that step is collected
when calling pipe_collect_out()
after the pipeline was run. See column
keepOut` when printing a pipeline to view the status.
Examples
p <- pipe_new("pipe", data = 1)
pipe_add(p, "add1", \(x = ~data, y = 1) x + y, keepOut = TRUE)
pipe_add(p, "add2", \(x = ~data, y = 2) x + y)
pipe_add(p, "mult", \(x = ~add1, y = ~add2) x * y)
p |> pipe_run() |> pipe_collect_out()
#> INFO [2025-01-03 19:12:48.263] Start run of 'pipe' pipeline:
#> INFO [2025-01-03 19:12:48.265] Step 1/4 data
#> INFO [2025-01-03 19:12:48.267] Step 2/4 add1
#> INFO [2025-01-03 19:12:48.269] Step 3/4 add2
#> INFO [2025-01-03 19:12:48.271] Step 4/4 mult
#> INFO [2025-01-03 19:12:48.272] Finished execution of steps.
#> INFO [2025-01-03 19:12:48.273] Done.
#> $add1
#> [1] 2
#>
pipe_set_keep_out(p, "add1", keepOut = FALSE)
pipe_set_keep_out(p, "mult", keepOut = TRUE)
p |> pipe_run() |> pipe_collect_out()
#> INFO [2025-01-03 19:12:48.276] Start run of 'pipe' pipeline:
#> INFO [2025-01-03 19:12:48.277] Step 1/4 data - skip 'done' step
#> INFO [2025-01-03 19:12:48.280] Step 2/4 add1 - skip 'done' step
#> INFO [2025-01-03 19:12:48.281] Step 3/4 add2 - skip 'done' step
#> INFO [2025-01-03 19:12:48.283] Step 4/4 mult - skip 'done' step
#> INFO [2025-01-03 19:12:48.284] Finished execution of steps.
#> INFO [2025-01-03 19:12:48.284] Done.
#> $mult
#> [1] 6
#>