centerx: Center Matrix

View source: R/centerx.r

centerxR Documentation

Center Matrix

Description

Centers a matrix.

Usage

centerx(x)

Arguments

x

a matrix

Details

Returns a centered matrix, i.e., each column of the matrix is replaced by deviations from its column mean.

Value

The centered matrix.

Author(s)

John Kloke, Joseph McKean

See Also

scale

Examples

x <- cbind(seq(1,5,length=5),seq(10,20,length=5))
xc <- centerx(x)
apply(xc,1,mean)

npsm documentation built on Nov. 15, 2023, 1:08 a.m.