gen_dims_comb_stats: Generate stats for all combinations of dims to be analysis

Description Usage Arguments Value Examples

Description

'gen_dims_comb_stats()' returns a list contains $2^length(all_dims)$ data frame. It will calculate the specified statistical indicators for each combination of dimensions to be analysis.

Usage

1
gen_dims_comb_stats(data, all_dims, fast = TRUE)

Arguments

data

data.table if 'fast' is 'TRUE' where data.frame if 'fast' is FALSE. It is the data divided by MRL so you should evaluate function 'calc_treated_data()' before using it.

all_dims

character vector of all dimensions.

fast

logic, default is 'TRUE'. Determine whether to use a more efficient function rewrite with data.table.

Value

a list contains $2^length(all_dims)$ data.frame. Each data.frame is named with dimensions' names connected with underline and contains dimensions columns and statistic columns.

Examples

1
2
3
4
5
6
# treated_data <- calc_treated_data(raw_data, mrl_data, "\u7532\u80fa\u78f7", "\u4e8c\u7532\u620a\u7075")
# dims <- c(names(RawColumnTrans), "product", "drug")
## fast mode
# gen_dims_comb_stats(data, dims)
## slow mode
# gen_dims_comb_stats(treated_data, dims, fast = FALSE)

YuanchenZhu2020/antgreens documentation built on Dec. 18, 2021, 8:20 p.m.