This function centers a variable around the mean. To create z-scores, specify `standardize=TRUE` A new column will be created with the centered values. There is also the option to center within context.

center(x, variables = c(colnames(x)), standardize = FALSE)

Arguments

x

dataframe

variables

c() of columns to standardize

standardize

Logical. Do you want to calculate zscores? (Default = FALSE)

Examples

center(x, subset = c(colnames(x)), standardize = FALSE)
#> Error in center(x, subset = c(colnames(x)), standardize = FALSE): unused argument (subset = c(colnames(x)))