m {MDMA}R Documentation

Mean center

Description

Mean center a vector or numeric matrix.

[Stable]

Usage

m(x)

Arguments

x

a numeric matrix or vector.

Details

This function resembles base::scale.default, with the scale argument set to FALSE. This, together with the short function name, is especially useful when you want to mean center variables in an analysis (e.g., using (g)lm), but you dont want the long form scale(x, scale=FALSE) to clutter up the rownames of the parameter estimates or the model anova.

Value

m returns a mean centered version of x. If x is a matrix, the matrix dimensions are preserved.

Author(s)

Mathijs Deen

Examples

vals <- matrix(rnorm(24, 15, 10), ncol = 2)
m(vals)

[Package MDMA version 1.1.0 Index]