center: Center matrix (subtract row mean from each row)

Description Usage Arguments Value Examples

View source: R/unsorted.R

Description

After centering, rowsums sum to zero. Particularly useful when working with categorical data in log-space.

Usage

1
center(x)

Arguments

x

vector or matrix

Value

matrix with centered rows

Examples

1
2
3
x <- matrix(rnorm(100), 10, 10)
y <- center(x)
rowSums(y)

jsilve24/driver documentation built on Jan. 30, 2022, 12:07 p.m.