colSums2: Column Sums (safe-ish)

View source: R/colSums2.R

colSums2R Documentation

Column Sums (safe-ish)

Description

calculate column sums for all columns, returning NA for columns that won't coerce to numeric

Usage

colSums2(df, remove_non_numeric = F, na.rm = T)

Arguments

df

a data frame with columns to sum

remove_non_numeric

a logical value determing whether or not NA values (ie. columns that cannot be cooreced to numeric and therefore won't sum) should be removed from the returned results

na.rm

a logical value determining if NA values should be ignored when summing

Value

a one-row data frame with the sum of each column. Columns that cannot be summed return NA unless remove_non_numeric=T


crazybilly/ucbudar documentation built on July 15, 2024, 5:03 p.m.