Center or standardize variables around the mean. A new column will be created with the centered values.

center(x, variables = c(), standardize = FALSE, drop = FALSE, suffix = NULL)

Arguments

x

dataframe

variables

c() of columns to standardize

standardize

Logical. Do you want to calculate zscores? Default is FALSE

drop

Drop original non-centered variables. Default is FALSE

suffix

Suffix to add at the end of the column names. Default is NULL and will add a _c for non-standardized and _z for standardized z-scores.