normalize: Normalize a vector to fit zero-to-one scale

Description Usage Arguments Examples

View source: R/transform.R

Description

Normalize a vector to fit zero-to-one scale

Usage

1
normalize(x, min = 0, max = 1, na.rm = FALSE)

Arguments

x

a numeric vector

min

numeric value. The lower bound of the interval to normalize x.

max

numeric value. The upper bound of the interval to normalize x.

na.rm

a logical indicating whether missing values should be removed

Examples

1

Example output

 [1] 0.4510638 0.4510638 0.5276596 0.4680851 0.3531915 0.3276596 0.1659574
 [8] 0.5957447 0.5276596 0.3744681 0.3148936 0.2553191 0.2936170 0.2042553
[15] 0.0000000 0.0000000 0.1829787 0.9361702 0.8510638 1.0000000 0.4723404
[22] 0.2170213 0.2042553 0.1234043 0.3744681 0.7191489 0.6638298 0.8510638
[29] 0.2297872 0.3957447 0.1957447 0.4680851

formattable documentation built on May 29, 2017, 7:04 p.m.