Re: [R] Summarizing counts by multiple factors

2010-05-12 Thread William Dunlap
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman > Sent: Tuesday, May 11, 2010 5:38 PM > To: r-help@r-project.org > Subject: [R] Summarizing counts by multiple factors > > Hi, > > An example data set is: >

Re: [R] Summarizing counts by multiple factors

2010-05-11 Thread Dennis Murphy
Hi: How about > as.data.frame(with(df, table(group, level, color))) group level color Freq 1 A 1 blue1 2 B 1 blue1 3 A 2 blue1 4 B 2 blue2 5 A 1 Red1 6 B 1 Red0 7 A 2 Red2 8 B 2 Red2 whe

Re: [R] Summarizing counts by multiple factors

2010-05-11 Thread David Winsemius
On May 11, 2010, at 9:08 PM, David Winsemius wrote: On May 11, 2010, at 8:38 PM, Noah Silverman wrote: Hi, An example data set is: grouplevelcolor A1"blue" A1"Red" B1"blue" B2"Red" A2"Red" B2

Re: [R] Summarizing counts by multiple factors

2010-05-11 Thread David Winsemius
On May 11, 2010, at 8:38 PM, Noah Silverman wrote: Hi, An example data set is: grouplevelcolor A1"blue" A1"Red" B1"blue" B2"Red" A2"Red" B2"Red" B2"blue" B2"

[R] Summarizing counts by multiple factors

2010-05-11 Thread Noah Silverman
Hi, An example data set is: grouplevelcolor A1"blue" A1"Red" B1"blue" B2"Red" A2"Red" B2"Red" B2"blue" B2"blue" A2"blue" A2"Red"