Double center a matrix by column and row means, resulting in a new matrix with zero row and column means.

doubleCent(X)

Arguments

X

A matrix or an object convertible to one.

Value

A double-centred matrix.

Examples

X <- matrix(1:12, 3, 4)
dc <- doubleCent(X)
round(rowMeans(dc), 10)
round(colMeans(dc), 10)