powered by
Rescale a numeric variable
rescale_var(x, new_min = 0, new_max = 1, x_min = min(x), x_max = max(x))
a numeric vector
The minimum value of the output
The maximum value of the output
The lowest possible value in x. By default this is the actual lowest value in x.
The highest possible value in x. By default this is the actual highest value in x.
rescale_var(1:10) rescale_var(1:10, new_min = -1, new_max = 1)
Run the code above in your browser using DataLab