powered by
Divide each element in the vector by the sum of the vector elements.
normalize(x)
Vector to be normalized
Normalized vector
# NOT RUN { x <- rep(1, 10) x <- normalize(x) x # }
Run the code above in your browser using DataLab