Skip to content

Commit

Permalink
Changes in the calculations.R
Browse files Browse the repository at this point in the history
  • Loading branch information
derekagorhom committed Nov 14, 2024
1 parent 5014510 commit 9e1d534
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,8 @@ DataBook$set("public", "apply_instat_calculation", function(calc, curr_data_list
if (any(stringr::str_detect("ordered", col_data_type))){
# put in here the ones that DO work for ordered factor

if (any(grepl("summary_count|summary_count_miss|summary_count_all|summary_min|summary_max|summary_range|summary_median|summary_quantile|p10|p20|p25|p30|p33|p40|p60|p67|p70|p75|p80|p90", formula_fn_exp))){

if (any(grepl("summary_count_non_missing|summary_count_missing|summary_n_distinct|summary_count|summary_min|summary_max|summary_range|summary_median|summary_quantile|p10|p20|p25|p30|p33|p40|p60|p67|p70|p75|p80|p90", formula_fn_exp))){
if (any(grepl("summary_count|summary_count_miss|summary_n_distinct|summary_count_all|summary_min|summary_max|summary_range|summary_median|summary_quantile|p10|p20|p25|p30|p33|p40|p60|p67|p70|p75|p80|p90", formula_fn_exp))){

curr_data_list[[c_data_label]] <- curr_data_list[[c_data_label]] %>%
dplyr::summarise(!!calc$result_name := !!rlang::parse_expr(calc$function_exp))
Expand All @@ -510,9 +509,8 @@ DataBook$set("public", "apply_instat_calculation", function(calc, curr_data_list
} else if (any(stringr::str_detect("factor | character", col_data_type))){
# put in here the ones that DO work for factor or character

if (any(grepl("summary_count|summary_count_miss|summary_count_all", formula_fn_exp))){

if (any(grepl("summary_count_non_missing|summary_count_missing|summary_n_distinct|summary_count", formula_fn_exp))){

if (any(grepl("summary_count|summary_count_miss|summary_n_distinct|summary_count_all", formula_fn_exp))){

curr_data_list[[c_data_label]] <- curr_data_list[[c_data_label]] %>%
dplyr::summarise(!!calc$result_name := !!rlang::parse_expr(calc$function_exp))
Expand Down

0 comments on commit 9e1d534

Please sign in to comment.