add_total_column: Add a total column to a tbl

View source: R/add_total_column.R

add_total_columnR Documentation

Add a total column to a tbl

Description

Sum up all numeric columns in a data frame

Usage

add_total_column(.data, name = "Total")

Arguments

.data

A tbl.

name

The output column name. If omitted, it will be Total.

Value

An object of the same class as .data

Examples

df <- data.frame(id = LETTERS[1:3], x1 = 1:3, x2 = 4:6, x3 = 7:9)
df
df %>% add_total_column()

overdodactyl/mRclwhip documentation built on June 30, 2023, 6:24 a.m.