rescaler: Rescale numeric vector

rescalerR Documentation

Rescale numeric vector

Description

Rescale a numeric vector to have specified maximum and minimum; modified from the scales package.

Usage

rescaler(x, to = c(0, 1), from = range(x, na.rm = TRUE))

Arguments

x

numeric vector of values

to

output range (numeric vector of length two)

from

input range (numeric vector of length two); if not given, from is calculated from the range of x

See Also

rescale; zero_range

Examples

rescaler(1:5, to = c(0, 1))
rescaler(1:5, to = c(0, 100))
rescaler(5, to = c(0, 100), from = c(0, 25))


raredd/rawr documentation built on March 4, 2024, 1:36 a.m.