View source: R/generate_modifiers.R
| add_column_total | R Documentation |
Add a column total
add_column_total(data, name = "total", label_total = "Total", ...)
data |
A data frame, tibble, or |
name |
Column name for total. Default value is |
label_total |
Label for the total column. Default is "Total". |
... |
Additional named arguments to be added as columns alongside the total column. |
The input data frame with an additional column representing the total of each row.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.