standardize | R Documentation |
This function standardizes a numeric vector by subtracting the mean and dividing by the standard deviation. The resulting vector will have a mean of 0 and a standard deviation of 1.
standardize(x)
x |
A numeric vector to be standardized. |
A numeric vector of the same length as x, containing the standardized values.
data <- c(1, 2, 3, 4, 5)
standardized_data <- standardize(data)
print(standardized_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.