Rfast (version 1.7.3)

Column and row-wise sums of a matrix: Column and row-wise sums of a matrix

Description

Column and row-wise sums of a matrix.

Usage

colsums(x)
rowsums(x)

Arguments

x
A numerical matrix with data.

Value

A vector with column sums or a column vector with the row sums.

See Also

colsums, colmeans, colVars

Examples

Run this code
x <- matrix(rpois(1000 * 1000,10),ncol = 1000)
x1 <- colsums(x)
x2 <- colSums(x)
all.equal(x1,x2)

x1 <- rowsums(x)
x2 <- rowSums(x)
all.equal(x1,x2)

Run the code above in your browser using DataLab