Learn R Programming

exvatools (version 0.9.0)

csums: 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)

Value

A row matrix (with rows and column names)

Arguments

df

A matrix with named rows and columns.

row_name

String, name to assign to resulting row.

Examples

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

Run the code above in your browser using DataLab