Learn R Programming

formattable (version 0.1.5)

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

Description

Normalize a vector to fit zero-to-one scale

Usage

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

Arguments

x
a 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

Run this code
normalize(mtcars$mpg)

Run the code above in your browser using DataLab