[R] using table and tapply?

Erin Hodgess erinm.hodgess at gmail.com
Mon Jun 21 04:24:00 CEST 2010


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  24        Botulinic     23
3851  2009-04-16      M  35   Constitutional     23
8495  2009-04-16      F  49   Constitutional     27
10967 2009-04-16      F  47   Constitutional     28
11164 2009-04-16      F  26   Constitutional     28
15220 2009-04-16      M  49 Gastrointestinal     30
1207  2009-04-16      F  39            Other     20
1514  2009-04-16      F  39            Other     20
2548  2009-04-16      M  49            Other     22
3430  2009-04-16      F  54            Other     23
>

sometimes I want use the date and obtain the totals deaths, sometimes
I want to use the Co and obtain the total number of deaths, etc.


I've tried "table" and "with" but am having no success.

Any help would be much appreciated.

thanks,
Erin




-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodgess at gmail.com



More information about the R-help mailing list