normalize: Scale data vector to 0-1-range (or another selectable range)

Description Usage Arguments Details Value Examples

View source: R/prepare.R

Description

Alternative names: min-max-scaling, data normalization.

Usage

1
normalize(x, lower.bound = 0, upper.bound = 1)

Arguments

x

numeric

lower.bound

Lowest value after scaling.

upper.bound

Highest value after scaling.

Details

For standardazing with sample mean and sample standard deviation use base::scale().

See Feature Scaling Wikipedia, Normalization Wikipedia.

TODO: support matrices and data.frames

Value

numeric

Examples

1
2
normalize(1:101)
normalize(rnorm(10, -10, 10), lower.bound = 0, upper.bound = 100)

BodoBurger/bodomisc documentation built on May 27, 2020, 5:12 p.m.