apply_df_: Apply a list of function calls to a data frame and return the...

View source: R/split_apply_.R

apply_df_R Documentation

Apply a list of function calls to a data frame and return the results in a data frame

Description

Apply a list of function calls to a data frame and return the results in a data frame

Usage

apply_df_(.data, fun_list = list(n = ~nrow(.data)), ...)

Arguments

.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 (list(n = ~nrow(.data))) returns the number of rows (observations) and stores it in a column named n.

...

additional optional arguments passed to apply_to_df_ (estimator_name and value).

@examples data(invented_wages) 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_df_(invented_wages, fun_list = fun)


gibonet/cuber documentation built on Dec. 24, 2024, 5:17 p.m.