Description Usage Arguments Details Value Examples
View source: R/flow-functions.R
Explicit cache of a function
1 | make_flow_fn(fn, fn_id = NULL, flow_options = get_flow_options())
|
fn |
Function to be cached, ideally a pure function. |
fn_id |
Optional id to uniquely identify the function. By default,
rflow functions reuse the |
flow_options |
List of options created using |
In order to use the functionality of an R6Flow
object, the output of
make_flow_fn
has to be collected first.
The cached version of the function.
1 2 3 4 5 6 7 8 9 10 11 | fn <- function(x, y) { x + y + 1 }
make_flow_function <- make_flow_fn(fn)
rflow_function <- make_flow_function(2, 3)
flow_result <- rflow_function %>% collect()
# usage with rflow pipes
fn2 <- function(x, y) { x * y }
make_flow_function2 <- make_flow_fn(fn2)
collected_pipe_flow <- make_flow_function(1, 2) %>%
make_flow_function2(2) %>%
collect()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.