Re: [R] grouped colSums without for loops?

From: Hans Ekbrand <>
Date: Tue, 18 Mar 2008 23:19:27 +0100

On Tue, Mar 18, 2008 at 12:05:23PM +0100, Albert Greinoecker wrote:
> try:
> aggregate(d[,2:3], by=list(d$foo), FUN=sum)

Great! Now I can get a data.frame as well as a list, thanks!

        Hans Ekbrand ( <>
Signature generated by Signify v1.14.  For this and more, visit

______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.

Received on Tue 18 Mar 2008 - 22:30:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 18 Mar 2008 - 23:30:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive