csums: Sum matrix columns and assign name to resulting row

View source: R/matrix_sum.R

csumsR Documentation

Sum matrix columns and assign name to resulting row

Description

Improved version of colSums() for matrix output. The sum of columns is kept as a row vector with column names and the resulting row can be named in the same command.

Usage

csums(df, row_name = NULL)

Arguments

df

A matrix with named rows and columns.

row_name

String, name to assign to resulting row.

Value

A row matrix (with rows and column names)

Examples

wio <- make_wio("wiodtest", quiet = TRUE)
csums(wio$Y, "TOTAL_Y")

exvatools documentation built on Sept. 17, 2024, 1:07 a.m.