standardize(data, mean = 0, sd = 1, include_dummy = FALSE)
Arguments
data
a data frame.
mean
mean of the transformed variables.
sd
standard deviation of the transformed variables.
include_dummy
logical. If TRUE, transform
dummy coded (0,1) variables.
Value
a data frame
Details
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.