add_totals_to_df | R Documentation |
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)
df |
Data frame to add total levels to. |
variables |
List of variables to add total levels to. |
level_names |
Names of total levels. Should have length 1 or same length
as |
sum_var |
String, name of variable to sum over. |
na.rm |
Optional. Logical. If TRUE, NAs are removed before summing. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.