center: Center Variables

View source: R/center.R

centerR Documentation

Center Variables

Description

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

Usage

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.


EngleLab/englelab documentation built on Sept. 9, 2024, 4:12 a.m.