rescale | R Documentation |
Rescale numeric vector
rescale(x, from = range(x, na.rm = TRUE, finite = TRUE), to = c(0, 1))
x |
A numeric vector. |
from |
The range of the original data. |
to |
The range of the rescaled data. |
A numeric vector with rescaled values.
x <- rnorm(10)
rescale(x)
rescale(x, from = c(0, 1))
rescale(x, to = c(0, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.