normalize {cwhmisc} | 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 <c-w.hoffmann@sunrise.ch>
http://www.wsl.ch/personal_homepages/hoffmann/index_EN
x <- matrix(rnorm(30),nrow=6) normalize(x) t(normalize(t(x))) # normalize the *rows* of x