Learn R Programming

ToolsForCoDa (version 1.1.0)

cen: centring of a data matrix

Description

centres the columns of a matrix to mean zero.

Usage

cen(X,w=rep(1,nrow(X))/nrow(X))

Value

returns a matrix

Arguments

X

a raw data matrix.

w

a vector of case weights.

Author

Jan Graffelman (jan.graffelman@upc.edu)

Examples

Run this code
X<-matrix(runif(10),ncol=2)
Y<-cen(X)
print(Y)

Run the code above in your browser using DataLab