Implicit cache of a function and of the given call.
flow_fn(..., fn = NULL, fn_id = NULL, flow_options = get_flow_options())
... | Named arguments to pass to |
---|---|
fn | The function to apply to the data frame. It must accept a data frame as the first argument and a numeric index as the second argument. |
fn_id | Optional id to uniquely identify the function. By default,
rflow functions reuse the |
flow_options | List of options created using |
The flow object.
Arguments fn
, fn_id
and flow_options
, when provided,
must be named. Argument fn
must be always provided.
fn <- function(x, y) { x + y + 2 } flowed_fn <- flow_fn(2, 3, fn = fn)#>collected_result <- flowed_fn %>% collect() # usage with rflow pipes fn2 <- function(x, y) { x * y } collected_pipe_result <- flowed_fn %>% flow_fn(2, fn = fn2) %>% collect()#>