standardize | R Documentation |
Simple extension to base::scale() to skip columns.
standardize(x, skip_vars = NULL, ...)
x |
Dataframe or matrix, assumed to have column names. |
skip_vars |
List of names of variables not to scale. |
... |
Extra arguments passed-through to base::scale |
Data-frame with appropriate variables scaled.
scale
library(ck37r)
data(Boston, package = "MASS")
# Don't scale our outcome variable.
data = standardize(Boston, skip_vars = "medv")
summary(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.