add_column_total: Add a column total

View source: R/generate_modifiers.R

add_column_totalR Documentation

Add a column total

Description

Add a column total

Usage

add_column_total(data, name = "total", label_total = "Total", ...)

Arguments

data

A data frame, tibble, or tsg object to which a column row will be added.

name

Column name for total. Default value is "total".

label_total

Label for the total column. Default is "Total".

...

Additional named arguments to be added as columns alongside the total column.

Value

The input data frame with an additional column representing the total of each row.

Examples

# Example data frame
df <- data.frame(
 category = c("A", "B", "C"),
 value1 = c(10, 20, 30),
 value2 = c(5, 15, 25)
 )
add_column_total(df)


tsg documentation built on Feb. 22, 2026, 5:08 p.m.