Learn R Programming

parameters (version 0.1.0)

standardize: Standardization

Description

Performs a standardization of data or parameters. See the documentation for your object's class:

Usage

standardize(x, ...)

# S3 method for numeric standardize(x, robust = FALSE, method = "default", verbose = TRUE, ...)

# S3 method for factor standardize(x, force = FALSE, ...)

Arguments

x

Object.

...

Arguments passed to or from other methods.

robust

Logical, if TRUE, centering is done by substracting the median from the variables and divide it by the median absolute deviation (MAD). If FALSE, variables are standardized by substracting the mean and divide it by the standard deviation (SD). the

method

The method of standardization. For data.frames, can be "default" (variables are divided by SD or MAD depending on robust) or "2sd" (divided by two times the deviation).

verbose

Toggle warnings on or off.

force

Logical, if TRUE, forces standardization of factors as well. Factors are converted to numerical values, with the lowest level being the value 1 (unless the factor has numeric levels, which are converted to the corresponding numeric value).

Value

The standardized object.