scale0: Scale Numeric Values to Defined Ranges

Description Usage Arguments Author(s) Examples

Description

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

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#

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))

#

miscset documentation built on May 2, 2019, 4:01 a.m.