powered by
Rescale numeric vector
rescale(x, from = range(x, na.rm = TRUE, finite = TRUE), to = c(0, 1))
A numeric vector with rescaled values.
A numeric vector.
The range of the original data.
The range of the rescaled data.
x <- rnorm(10) rescale(x) rescale(x, from = c(0, 1)) rescale(x, to = c(0, 2))
Run the code above in your browser using DataLab