normalize: Normalize numeric variables

View source: R/normalize.R

normalizeR Documentation

Normalize numeric variables

Description

Normalize the numeric variables in a data frame

Usage

normalize(data, new_min = 0, new_max = 1)

Arguments

data

a data frame.

new_min

minimum for the transformed variables.

new_max

maximum for the transformed variables.

Details

normalize transforms all the numeric variables in a data frame to have the same minimum and maximum values. By default, this will be a minimum of 0 and maximum of 1. Character variables and factors are left unchanged.

Value

a data frame

Note

Use this function to be transform variables into a given range. The default is [0, 1], but [-1, 1], [0, 100], or any other range is permissible.

Examples

head(mtcars)

mtcars_st <- normalize(mtcars)
head(mtcars_st)

Rkabacoff/factorAnalysis documentation built on March 21, 2022, 3:15 p.m.