View source: R/data_frame_functions.R
df_standardize | R Documentation |
Standardize all variables in a data.frame. Can use weighted standardization. Wraps standardize
.
df_standardize(
df,
exclude = NULL,
messages = T,
exclude_logicals = T,
exclude_range_01 = T,
w = NULL
)
df |
(data frame) The data frame. |
exclude |
(chr vector) Names of variables to not standardize. |
messages |
(lgl scalar) Whether to output messages. |
exclude_logicals |
Exclude boolean/logical variables |
exclude_range_01 |
Exclude variables that range between 0 and 1 |
w |
(num vector) Weights to use, if any. |
Returns a standardized data.frame, i.e. one where every variable has mean 0 and sd 1.
head(iris) #not standardized
head(df_standardize(iris)) #standardized
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.