add_total_level_to_var | R Documentation |
Add a new level to a variables which is the sum of all other levels.
add_total_level_to_var(
df,
variable,
level_name = "Total",
sum_var = "value",
na.rm = TRUE
)
df |
Data frame to add total levels to. |
variable |
Name of variable to add total level to. |
level_name |
Total level name. |
sum_var |
String, name of variable to sum over. |
na.rm |
Optional. Logical. If TRUE, NAs are removed before summing. |
A data frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.