normalize | R Documentation |
The normalize
function takes a numeric vector and normalizes its values
to a specified range.
normalize(x, range = c(0, 1))
x |
A numeric vector to be normalized. |
range |
A numeric vector specifying the desired range. The default range is 0, 1. |
A numeric vector with values normalized to the specified range.
scale
x <- c(1, 2, 3, 4, 5)
normalize(x) # Normalize x to the default range [0, 1]
normalize(x, range = c(0, 100)) # Normalize x to the range [0, 100]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.