powered by
Centre then divide by the standard error of the values in a numeric variable
standardizeVars(.data, vars, names = paste(sep = ".", vars, "std"))
the original dataframe containing new columns of the standardized variables with tidyverse code attached
a dataframe with the columns to standardize
a character vector of the numeric variables in .data to standardize
.data
names for the created variables
Owen Jin, Tom Elliott
code
standardized <- standardizeVars(iris, var = c("Sepal.Width", "Petal.Width")) cat(code(standardized)) head(standardized)
Run the code above in your browser using DataLab