prep_df_summ_aggr.Rd
This function prepares a summarized dataframe based on provided variables, y-variable, color, and total count. The function groups the dataframe by the provided variables, calculates the weighted mean for the y-variable, sums up total count per group, and arranges by color.
A dataframe to be summarized
A character vector specifying the columns to be grouped by
A character vector specifying the column to be summarized
A character vector specifying the column to be used for color arrangement
A symbol specifying the variable to be used for total count calculation
A symbol specifying the variable to be used for color assignment
A summarized and aggregated dataframe arranged by color
df <- data.frame( split_var_value = c("male", "male", "female", "female", "dutch", "dutch",
"EER", "EER", "Outside EER", "Outside EER"), other_var = c("Early", "Late", "Early", "Late",
"Early", "Late", "Early", "Late", "Early", "Late"), value = c(2, 4, 6, 8, 10, 2, 4, 6, 8, 10),
total = c(10, 10, 20, 20, 30, 30, 40, 40, 50, 50), split_var = c("gender", "gender", "gender",
"gender", "background", "background", "background", "background", "background", "background") )