Learn R Programming

psycho (version 0.4.91)

standardize.numeric: Standardize (scale and reduce) numeric variables.

Description

Standardize (Z-score, "normalize") a vector.

Usage

# S3 method for numeric
standardize(x, normalize = FALSE, ...)

Arguments

x

Numeric vector.

normalize

Will perform a normalization instead of a standardization. This scales all numeric variables in the range 0 - 1.

...

Arguments passed to or from other methods.

Examples

Run this code
# NOT RUN {
standardize(x = c(1, 4, 6, 2))
standardize(x = c(1, 4, 6, 2), normalize = TRUE)
# }

Run the code above in your browser using DataLab