column_sums: Sum up the Numeric Columns of a Data Frame

View source: R/column_sums.R

column_sumsR Documentation

Sum up the Numeric Columns of a Data Frame

Description

I often need to calculate the sums of the numeric columns of a data.frame. While colSums requires the data frame to be numeric, this is a convenience wrapper to select numeric columns only.

Usage

column_sums(x, ...)

Arguments

x

A data.frame.

...

Arguments passed to colSums.

Value

A named vector of column sums (see colSums).

See Also

Other statistics: count_groups(), relative_difference(), round_half_away_from_zero(), sloboda(), weighted_variance()

Examples

try(colSums(iris))
column_sums(iris)
names(iris) # no column sum for `Species`

fritools documentation built on Nov. 19, 2023, 1:06 a.m.