apply_ | R Documentation |
Apply a list of function calls to a data frame and return the results in a list
apply_(.data, fun_list = list(n = ~nrow(.data)))
.data |
a data frame. |
fun_list |
a named list of formulas with the desired function calls to
be evalutated on the data frame. The default value ( |
a named list with the results of the function calls applied to the data frame.
str(invented_wages)
# First create a list of function calls (with formulas)
fun <- list(m1 = ~weighted.mean(wage, sample_weights), s = ~sum(sample_weights))
# And then apply them to the data
apply_(invented_wages, fun_list = fun)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.