pLvlCenter: Center Variables at the Participant Level

Description Usage Arguments Value

Description

Center Variables at the Participant Level

Usage

1
2
pLvlCenter(df, var, group = "pnum", cntrValFn = mean,
  returnType = c("df", "vec"), ...)

Arguments

df

Data frame.

var

Variable in df to center.

group

Grouping variable. Must be in df!

cntrValFn

Function that returns the value to center around within each participant. Most often the default, mean.

returnType

Can return either a dataframe ("df"; default) or a vector ("vec").

...

Other arguments to pass to ctrlValFn.

Value

Either a dataframe with the new variable or a vector of the centered values, depending on the returnType argument.


Cmell/CMUtils documentation built on June 26, 2019, 4:34 p.m.