A function that rescales a vector of values to have a new minimum and maximum.

new_limits(x, lower, upper, ...)

Arguments

x

A vector of numeric values.

lower

The new lower limit or minimum value.

upper

The new upper limit or maximum value.

...

Additional parameters for the min and max functions.

Value

A vector of rescaled values.

Examples

x <- 1:3
new_limits( x, 0, 1 )
#> [1] 0.0 0.5 1.0