normalize: Normalize

View source: R/maths.R

normalizeR Documentation

Normalize

Description

Normalizes a vector of values to a range of 0-1 x - min(x)) / (max(x) - min(x)

Usage

normalize(x, newlims = c(0, 1))

Arguments

x

Vector of values

newlims

numeric vector of new minimum and maximum eg. c(2,4)

Value

Normalized vector of values to newmax and newmin

Examples

normalize(mtcars$mpg)
normalize(mtcars$mpg, c(5, 10))

TheZetner/utilitarian documentation built on Aug. 13, 2022, 12:31 p.m.