Skip to contents

Set data in first step of pipeline.

Usage

pipe_set_data(pip, data)

Arguments

pip

Pipeline object

data

initial data set.

Value

returns the Pipeline object invisibly

Examples

p <- pipe_new("pipe", data = 1)
pipe_add(p, "add1", \(x = ~data, y = 1) x + y, keepOut = TRUE)
p |> pipe_run() |> pipe_collect_out()
#> INFO  [2025-01-03 19:12:47.389] Start run of 'pipe' pipeline:
#> INFO  [2025-01-03 19:12:47.390] Step 1/2 data
#> INFO  [2025-01-03 19:12:47.392] Step 2/2 add1
#> INFO  [2025-01-03 19:12:47.393] Finished execution of steps.
#> INFO  [2025-01-03 19:12:47.394] Done.
#> $add1
#> [1] 2
#> 

pipe_set_data(p, 3)
p |> pipe_run() |> pipe_collect_out()
#> INFO  [2025-01-03 19:12:47.397] Start run of 'pipe' pipeline:
#> INFO  [2025-01-03 19:12:47.398] Step 1/2 data
#> INFO  [2025-01-03 19:12:47.399] Step 2/2 add1
#> INFO  [2025-01-03 19:12:47.401] Finished execution of steps.
#> INFO  [2025-01-03 19:12:47.401] Done.
#> $add1
#> [1] 4
#>