Min-max scaling

minmax(x)

Arguments

x

num array to be scaled

Value

num array, same length as x

Details

Output values are scaled to range between 0 and 1 $$x_{s}=\frac{x-x_{min}}{x_{max}-x_{min}}$$

NA

See also

Author

torben.kimhofer@gmail.com

Examples

x=rnorm(20, 0, 1) plot(x, type='l'); abline(h=range(x), lty=2)
points(minmax(x), type='l', col='red'); abline(h=c(0,1), col='red', lty=2)