add_node {sewage}R Documentation

add node to a sewage pipeline

Description

add_node() will place a new node in the specified pipeline. This will be executed sequentially when the pipeline is executed using run()

Usage

add_node(pipeline, component, name, input, ...)

Arguments

pipeline

an initialized sewage pipeline

component

a function to be executed. Must be a valid function specification or exported sewage object including Joiner and Splitter

name

a name to give to the given component. This will be used as the 'input' parameter for downstream nodes

input

the node to use as input into 'component'. Inputs should be either (1) the name of an existing node in the pipeline, or (2) the name(s) of any argument(s) in the first ndoe of the pipeline. These names can be whatever you want, but should match the arguments you pass to run()

...

additional arguments to be passed to the 'component' argument

Value

a sewage_pipeline object

Examples

my_func = function(df) {
    df %>%
        head(15)
}
pipeline = Pipeline()
pipeline = pipeline |>
    add_node(name = 'processor', component = my_func, input = 'file')

[Package sewage version 0.2.5 Index]