element: Extract an element from an 'R6Flow' object

Description Usage Arguments Value Examples

View source: R/flow-functions.R

Description

Extract an element from an R6Flow object

Usage

1
2
3
4
element(flow, name = NULL)

## S3 method for class '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

1
2
3
4
5
6
7
fn <- function(x, y) { list(x = x, y = y, Z = 6) }
flowed_fn <- flow_fn(2, 3, fn = fn) 
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)
element_name <- flowed_fn["x"]$elem_name

numeract/rflow documentation built on May 28, 2019, 3:39 p.m.