add_totals_to_df: Add total levels to multiple variables

View source: R/add_totals.R

add_totals_to_dfR Documentation

Add total levels to multiple variables

Description

Wrapper around add_total_level_to_var to add levels to total level to multiple variables.

Usage

add_totals_to_df(df, variables, level_names, sum_var = "value", na.rm = TRUE)

Arguments

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 variables.

sum_var

String, name of variable to sum over.

na.rm

Optional. Logical. If TRUE, NAs are removed before summing.


pxmake documentation built on April 11, 2025, 6:06 p.m.