values.to.range: Scale values into a given range.
Description
Linearly maps the values to the target range. Values which are all identical (or a single value) are mapped to the middle of the range.
Usage
values.to.range(x, target_range)
Value
numeric vector of the same length as x, the scaled values.
Arguments
- x
numeric vector, the input values.
- target_range
numeric vector of length 2, the target range.