Performs a standardization of data or parameters. See the documentation for your object's class:
standardize(x, ...)# S3 method for numeric
standardize(x, robust = FALSE, method = "default",
verbose = TRUE, ...)
# S3 method for factor
standardize(x, force = FALSE, ...)
Object.
Arguments passed to or from other methods.
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
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).
Toggle warnings on or off.
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).
The standardized object.