powered by
This function normalizes a numeric vector so that all values are scaled to the range [0, 1].
normalize.vector(x)
A numeric vector with values scaled to the range [0, 1]. If all values are identical, all values are set to 0.
A numeric vector to be normalized.
# Example with a numeric vector normalize.vector(c(1, 2, 3, 4, 5)) # Example with a vector containing identical values normalize.vector(c(3, 3, 3))
Run the code above in your browser using DataLab