[R] more efficient sum of matrix columns

Jean Eid jeaneid at chass.utoronto.ca
Sun Jun 15 02:51:29 CEST 2003


Dear R users,
I am looking for a more efficient way to compute the sum of columns of a
matrix.
I am currently using apply(data, 2, sum) however, I am building a data set
from another one by summing the columns of some parts of the matrix.
the loop is taking too long (about 1/2 hour) for a 4462 * 202 matrix.
thanks,
Jean Eid




More information about the R-help mailing list