On 4/14/2008 7:30 AM, zerfetzen wrote: > Thanks all. I will try to use both tapply and by, and have no idea how I > missed the by function. Thanks again.
One problem with both of those arises if you are subsetting on several columns. They will do the calculations for all combinations of all columns, even if only a few combinations of levels are present in your dataset. This can make the calculation take up a large amount of memory. I wrote the sparseby function to handle this case; it is in the reshape package. Duncan Murdoch ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.