mat_add_total_col: Add rowSums over some variables

mat_add_total_colR Documentation

Add rowSums over some variables

Description

If not specified, over all numeric columns

Usage

mat_add_total_col(df, ...)

Arguments

df

data

...

variables

Examples

library(dplyr)
df <- data.frame(Char = c("A", "B"),
                 var_1 = c(1,2),
                 var_2=c(1,2),
                 other = c(9,10))
mat_add_total_col(df)
mat_add_total_col(df, var_1)
mat_add_total_col(df, -var_1, -Char)
mat_add_total_col(df, starts_with("var"))
mat_add_total_col(df, starts_with("not found"))

MatthieuStigler/matPkg documentation built on Nov. 13, 2023, 7:53 p.m.