Apply - by row
Fast computation of sweep(X, MARGIN = 2, FUN = "-", STATS = center)
rowCenter_cpp(X, center)
X |
A matrix. |
center |
a numeric vector of length equal to the number of rows of |
A matrix of same size as X.
Brice Ozenne <broz@sund.ku.dk>
x <- matrix(1,6,5) sweep(x, MARGIN = 2, FUN = "-", STATS = 1:5) rowCenter_cpp(x, 1:5 ) rowCenter_cpp(x, colMeans(x) )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.