mat_add_total_col: Add rowSums over some variables

Description Usage Arguments Examples

Description

If not specified, over all numeric columns

Usage

1

Arguments

df

data

...

variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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 Aug. 10, 2021, 11:01 a.m.