powered by
It centers a numeric matrix with dimension N x N by row (rows=TRUE) or column (rows=FALSE).
centerX(X, rows = TRUE)
Centered X (class "matrix").
Numeric matrix or data.frame of any size.
If TRUE, the operation is done by row; otherwise, it is done by column. (Defaults: TRUE).
dat <- matrix(rnorm(25),ncol=5,nrow=5) centerX(dat)
Run the code above in your browser using DataLab