Description Usage Arguments Value Author(s) Examples
View source: R/minmax-scaling.R
Applies a rescaling that linearly transforms the values into a specified range of values.
1 | minmax_scaling(values, lower = 0, upper = 1)
|
values |
A numeric vector of values |
lower, upper |
The lower and upper bounds of the range that the values are mapped onto |
A numeric vector that contains the rescaled values
Mathias Isaksen mathiasleanderi@gmail.com
1 2 3 4 5 6 7 8 | set.seed(123)
# Generate values from normal distribution
original.values = rnorm(100, -4, 5)
# The values lie between approximately -15.5 and 7
hist(original.values)
# Rescale values to the interval [0, 1]
rescaled.values = minmax_scaling(original.values)
hist(rescaled.values)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.