Skip to contents

Group-centering of one or more variables

Usage

group_center(variables, group, data, std = FALSE, prefix = "g.")

Arguments

variables

Character vector of variables names

group

Character of length 1,name of grouping variable

data

Data frame

std

Logical. Should the variable be standardized (divided by its std. deviation)?

prefix

Character, added to the befinning of centered variable name.

Value

Returns an original data frame binded with the new centered variables