apply_to_df_: Put the results of 'apply_' in a data frame

View source: R/split_apply_.R

apply_to_df_R Documentation

Put the results of 'apply_' in a data frame

Description

Put the results of 'apply_' in a data frame

Usage

apply_to_df_(.list, estimator_name = "estimator", value = "value")

Arguments

.list

the output of apply_.

estimator_name

character string with the name to be given to the column with the type of the estimated statistics (default: "estimator").

value

character string with the name of the column that will contain the values of the estimated statistics (default: "value").

Examples

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
tmp <- apply_(invented_wages, fun_list = fun)
tmp
str(tmp)

# The results of 'apply_' are stored in a list. 'apply_to_df_' transforms
# them in a data frame:
apply_to_df_(tmp)


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