Hi!

I have large matrices, one column per variable and I have a vector of factors / grouping symbols. Then I am computing subtotals for the groups but it takes pretty long and thus I wanted to ask if there is a better way to do it or if this is already the best way:
subTotals <- function(x, groupvec) do.call("rbind",lapply(split(x,groupvec),colSums,na.rm=T))


Thanks reading my question and any hints!
 Werner

		
---------------------------------

	[[alternative HTML version deleted]]


