scale0 {miscset}R Documentation

Scale Numeric Values to Defined Ranges

Description

Scale numeric values to a range from 0 to 1 with the function scale0 or to a chosen range with scaler.

Usage

scale0(x)

scaler(x, r = c(0, 1), b = range(x, na.rm = TRUE))

Arguments

x

Numeric vector to transform.

r

Numeric vector of length 2 for range to scale values of x to.

b

Numeric vector of length 2 to define the border of x to use as scaling minimum and maximum.

Author(s)

Sven E. Templer

Examples

#

scale0(0:10)
scale0(-1:3)
scale0(2:3)

scaler(0:10)
scaler(0:10, 1:2)
scaler(0:10, 1:2, c(0, 20))

#

[Package miscset version 1.1.0 Index]