normalize: Normalize Vector

View source: R/wrangling.R

normalizeR Documentation

Normalize Vector

Description

This function normalizes numerical values into a specified range, defaulting to the 0 to 1 range.

Usage

normalize(x, range = c(0, 1), ...)

Arguments

x

Numeric vector. The numbers to be normalized.

range

A numeric vector of length 2 specifying the desired range for normalization. Default is c(0, 1).

...

Additional parameters.

Value

A numeric vector with normalized x values.

See Also

Other Data Wrangling: balance_data(), categ_reducer(), cleanText(), date_cuts(), date_feats(), file_name(), formatHTML(), holidays(), impute(), left(), num_abbr(), ohe_commas(), ohse(), quants(), removenacols(), replaceall(), replacefactor(), textFeats(), textTokenizer(), vector2text(), year_month(), zerovar()

Examples

x <- c(0, 1, 4, 7.5, 10)
normalize(x)
normalize(x, range = c(-1, 1))

laresbernardo/lares documentation built on Jan. 14, 2025, 2:22 a.m.