new_composed | R Documentation |
Create composed functions
new_composed(fns, dir = NULL, ..., class = character())
fns |
A list of functions to compose. |
dir |
Direction of composition, either |
... |
Additional arguments for attributes. |
class |
Name of subclass. |
A composed function that inherits from adverbial_function_compose
.
purrr::compose()
square <- function(x) x ^ 2
cdist <- new_composed(list(square = square, sum = sum, sqrt = sqrt))
cdist(1:10)
cdist$sum <- new_partialised(sum, list(na.rm = TRUE))
cdist(c(1:10, NA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.