normalize | R Documentation |
Normalize a vector or a matrix (by columns), using euclidian norm
normalize(x)
x |
Vector or matrix to be normalized |
The normalized matrix (1 column if x is a vector)
x <- matrix(c(1,2,-1,3), ncol=2) normalize(x) #column 1 is 1/sqrt(5) (1 2), #and column 2 is 1/sqrt(10) (-1, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.