View source: R/stats_extensions.R
standardize | R Documentation |
Transform values in x
such that the mean is approximately 0 and the standard
deviation is approximately 1. Note that this is a whole-cloth reimplemntation
of a function of the same name from the rethinking
package by Dr. Richard McElreath.
standardize(x)
x |
A vector of values to be scaled. |
x <- rnorm(1000, mean = 3, sd = 4)
z <- standardize(x)
mean(z)
sd(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.