Skip to contents

Subtracts a centering value from a variable.

Usage

center_variable(x, center)

Arguments

x

The variable to center.

center

The centering value.

Value

The centered variable.

Examples

center_variable(10, 5) # Returns 5
#> [1] 5
center_variable(c(1, 2, 3, 4, 5), 3) # Returns c(-2, -1, 0, 1, 2)
#> [1] -2 -1  0  1  2