standardize | R Documentation |
This function is a wrapper around gscale()
that is configured
to do a conventional standardization of continuous variables,
mean-centering and dividing by one standard deviation.
standardize(
data = NULL,
vars = NULL,
binary.inputs = "center",
binary.factors = FALSE,
weights = NULL
)
data |
A data frame or survey design. Only needed if you would like to
rescale multiple variables at once. If |
vars |
If |
binary.inputs |
Options for binary variables. Default is |
binary.factors |
Coerce two-level factors to numeric and apply scaling functions to them? Default is FALSE. |
weights |
A vector of weights equal in length to |
Some more information can be found in the documentation for
gscale()
A transformed version of the data
argument.
standardization, scaling, and centering tools
center()
,
center_mod()
,
gscale()
,
scale_mod()
# Standardize just the "qsec" variable in mtcars
standardize(mtcars, vars = "qsec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.