unitize | R Documentation |
Rescales each column of a matrix to produce vectors of length one.
unitize(mat)
mat |
A matrix of real numbers. |
No details beyond the simple description are requires; it is implemented exactly the way you would suspect.
A matrix of the same size as the input matrix.
Kevin R. Coombes <krc@silicovore.com>
simmat <- matrix(rnorm(12), 3, 4)
U <- unitize(simmat)
apply(U^2, 2, sum) # check unit length
simmat/U # view normalization factors
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.