Center a matrix row-wise

rowCenter(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 nrow(m) of values to be subtracted from each row.

Value

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