m | R Documentation |
Mean center a vector or numeric matrix.
m(x)
x |
a numeric matrix or vector. |
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.
m
returns a mean centered version of x
. If x
is
a matrix, the matrix dimensions are preserved.
Mathijs Deen
vals <- matrix(rnorm(24, 15, 10), ncol = 2)
m(vals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.