Extract an element from an R6Flow object.

element(flow, name = NULL)

# S3 method for R6Flow
[(flow, name)

Arguments

flow

A flow object, e.g. as returned by flow_fn.

name

Element of the output data to be selected. The default is name = NULL, which returns the element version of the R6Flow input object.

Value

An object with class Element.

Examples

fn <- function(x, y) { list(x = x, y = y, Z = 6) } flowed_fn <- flow_fn(2, 3, fn = fn)
#> New cache: fn=fn / fn_id=1 / fn_key=018ed91800e3e321
flow_element <- element(flowed_fn, "x") fn <- function(x, y) { list(x = x, y = y, Z = 7) } flowed_fn <- flow_fn(2, 3, fn = fn)
#> New cache: fn=fn / fn_id=1 / fn_key=d1e900857f0d0f4f
element_name <- flowed_fn["x"]$elem_name