[R] How to use tapply with more than one variables grouped

noobmin pseudovoid at hotmail.com
Tue Oct 23 13:41:51 CEST 2012

I believe that previously could not be understood. To facilitate'll give you
an example. Assuming my table is presented below with the amount received
from each candidate for president in a particular country state.

                   AL  AR  CA  NY
Doug     250 250 250  NA
Jennifer  20 340 300 100
Michele  250 500 250  60
Obama     15  45 520 600

I would like to list the states where Obama has higher amount received (ie
in CA and NY) and also the number of states, in this case 2. How to do this?


View this message in context: http://r.789695.n4.nabble.com/How-to-use-tapply-with-more-than-one-variables-grouped-tp4646948p4647111.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list