Normalizes a count matrix X for correspondence analysis and returns the corresponding metric. The normalization for X is as follows: First the row sums of X are computed, giving the weights for each sample. These weights are stored in a matrix D, which defines an inner product on the columns of X. Then the vectors of counts stored in the rows of X are replaced with proportions, and the resulting matrix is centered according to the inner product defined by D. Both the centered data matrix and D are returned to the user.
normalizeMatrix(X)A list with the normalized matrix (Xtilde) and the
row weights (D).
The matrix to be normalized.