as_function {purrr} | R Documentation |
as_function
is the powerhouse behind the varied function
specifications that purrr functions allow. This is an S3 generic so that
other people can make as_function
work with their own objects.
as_function(.f, ...) ## S3 method for class 'character' as_function(.f, ..., .null = NULL)
.f |
A function, formula, or atomic vector. If a function, it is used as is. If a formula, e.g. If character or integer vector, e.g. |
... |
Additional arguments passed on to methods. |
.null |
Optional additional argument for character and numeric inputs. |
as_function(~ . + 1) as_function(1) as_function(c("a", "b", "c")) as_function(c("a", "b", "c"), .null = NA)