[R] categorical data

From: Christian Oswald <oswald_at_dhlaw.de>
Date: Thu 10 Aug 2006 - 02:07:00 EST


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. Received on Thu Aug 10 02:13:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 10 Aug 2006 - 06:21:08 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.