Normalize vector to sum to 1.
Divide each element in the vector by the sum of the vector elements.
normalize(x)
x |
Vector to be normalized |
Normalized vector
Albert Y. Kim
x <- rep(1, 10) x <- normalize(x) x
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.