Center a matrix column-wise

colCenter(m, method = "mean", centerBy = NULL)

Arguments

m

a matrix

method

a character string. one of "mean" or "median" definining how to do the centering. Default: "mean"

centerBy

a numeric vector of length equal to ncol(m) of values to be subtracted from each row.

Value

a matrix centered by columns such that the statistic defined in method is equal to 0 for each column.