Dear List, I neeed a grouped list with two sort of categorical data. I have a data .frame like this. year cat. b c 1 2006 a1 125 212 2 2006 a2 256 212 3 2005 a1 14 12 4 2004 a3 565 123 5 2004 a2 156 789 6 2005 a1 1 456 7 2003 a2 786 123 8 2003 a1 421 569 9 2002 a2 425 245
I need a list with the sum of b and c for every year and every cat (a1, a2 or a3) in this year. I had used the tapply function to build the sum for every year or every cat. How can I combine the two grouping values? Thanks, Christian ______________________________________________ R-help@stat.math.ethz.ch 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.