normalize: Scale a vector to 0-1 by min and max

Description Usage Arguments Value Examples

View source: R/helper.r

Description

Scale a vector to 0-1 by min and max

Usage

1
normalize(x, na.rm = TRUE)

Arguments

x

numeric

na.rm

bool whether to remove NA values.

Value

a normalized vector

Examples

1
2
normalize(0:10)
normalize(c(1, 100, NA, 10), na.rm = TRUE)

yanxianUCSB/gen5helper documentation built on June 22, 2020, 3:35 a.m.