Wrapper around add_total_level_to_var to add levels to total level to multiple variables.
add_totals_to_df(df, variables, level_names, sum_var = "value", na.rm = TRUE)
Data frame to add total levels to.
List of variables to add total levels to.
Names of total levels. Should have length 1 or same length
as variables
.
String, name of variable to sum over.
Optional. Logical. If TRUE, NAs are removed before summing.