powered by
Create composed functions
new_composed(fns, dir = NULL, ..., class = character())
A composed function that inherits from adverbial_function_compose.
adverbial_function_compose
A list of functions to compose.
Direction of composition, either "forward" or "backward". By default, the functions are composed in the forward direction. Passed to purrr::compose().
"forward"
"backward"
purrr::compose()
Additional arguments for attributes.
Name of subclass.
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))
Run the code above in your browser using DataLab