Re: [R] using table and tapply?

2010-06-21 Thread Charles C. Berry
On Sun, 20 Jun 2010, Erin Hodgess wrote: Dear R People: Here is a little section of a data frame: zzz[1:10,] DATE GENDER AGE Co DEATH1 3945 2009-04-16 M 24Botulinic 23 3851 2009-04-16 M 35 Constitutional 23 8495 2009-04-16 F 49

[R] using table and tapply?

2010-06-20 Thread Erin Hodgess
Dear R People: Here is a little section of a data frame: zzz[1:10,] DATE GENDER AGE Co DEATH1 3945 2009-04-16 M 24Botulinic 23 3851 2009-04-16 M 35 Constitutional 23 8495 2009-04-16 F 49 Constitutional 27 10967 2009-04-16

[R] using table and tapply? solved

2010-06-20 Thread Erin Hodgess
Here is my solution: tapply(zzz$DEATH1,zzz$GENDER,sum, na.rm=TRUE) Dear R People: Here is a little section of a data frame: zzz[1:10,] DATE GENDER AGE Co DEATH1 3945 2009-04-16 M 24Botulinic 23 3851 2009-04-16 M 35 Constitutional 23