normalize {cwhmath} | R Documentation |
Normalize the columns of a matrix.
normalize(x)
x |
the matrix containing the vectors to be normalized as columns. |
The matrix containing the normalized vectors as columns. If you
want to normalize the rows of a matrix, use t(normalize(t(x)))
Christian W. Hoffmann, christian.hoffmann@wsl.ch,
http://www.wsl.ch/staff/christian.hoffmann
x <- matrix(rnorm(30),nrow=6) normalize(x) t(normalize(t(x))) # normalize the *rows* of x