Apply crossprod and colSums
Fast computation of crossprod(colSums(X),Y)
colSumsCrossprod(X, Y, transposeY)
X |
A matrix with dimensions k*n. Hence the result of |
Y |
A matrix with dimenions n*m. Can be a matrix with dimension m*n but then |
transposeY |
Logical. If |
A vector of length m.
Thomas Alexander Gerds <tag@biostat.ku.dk>
x <- matrix(1:8,ncol=2) y <- matrix(1:16,ncol=8) colSumsCrossprod(x,y,0) x <- matrix(1:8,ncol=2) y <- matrix(1:16,ncol=2) colSumsCrossprod(x,y,1)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.