Skip to contents

The range01 function rescales a vector to the range [0, 1].

Usage

range01(x, ...)

Arguments

x

A numeric vector to be rescaled.

...

Additional arguments to be passed to min and max functions.

Value

A numeric vector with values rescaled to the range [0, 1].

Examples

# Rescale a vector to the range [0, 1]
x <- c(1, 2, 3, 4, 5)
range01(x)
#> [1] 0.00 0.25 0.50 0.75 1.00