standardize | R Documentation |
Standardize the numeric variables in a data frame
standardize(data, mean = 0, sd = 1, include_dummy = FALSE)
data |
a data frame. |
mean |
mean of the transformed variables. |
sd |
standard deviation of the transformed variables. |
include_dummy |
logical. If |
standardize
transforms all the numeric variables
in a data frame to have the same mean and standard deviation.
By default, this will be a mean of 0 and standard deviation of 1.
Character variables and factors are left unchanged. By default,
dummy coded variables are also left unchanged. Use
include_dummy=TRUE
to transform these variables as well.
a data frame
head(mtcars) mtcars_st <- standardize(mtcars) head(mtcars_st)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.