| minmax | R Documentation |
This function rescales a numeric vector using the min-max normalization technique,
which linearly transforms the values to a new range specified by the a and
b arguments. The minimum value in the original vector is mapped to a, and
the maximum value is mapped to b.
minmax(x, a = 0, b = 1, drop_na = TRUE, drop.na = deprecated())
x |
A numeric vector. |
a |
The minimum value of the new range (default: 0). |
b |
The maximum value of the new range (default: 1). |
drop_na |
A logical value indicating whether to remove missing values
(NA). If |
drop.na |
A numeric vector with values rescaled to the new range [a, b].
Christian L. Goueguel
data(forageLIBS)
head(minmax(forageLIBS$K))
head(minmax(forageLIBS$S, a = -1, b = 1, drop_na = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.