[R] categorical data

Christian Oswald oswald at dhlaw.de
Wed Aug 9 18:07:00 CEST 2006


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



More information about the R-help mailing list