0

I have the following data set over 6 months and I need to compute the number of individuals choosing options A, B or C on a daily basis (the options are several characters in length).

User    Date        Option     
90   2013-01-28       A      
26   2013-02-04       B      
23   2013-02-04       A     
23   2013-01-07       C      
84   2013-02-27       B     
57   2013-01-30       A

Ultimately, I'm hoping for the dataframe to have the following form.

   Date      Option     Count
2013-01-01     A         203
2013-01-01     B         75
2013-01-01     C         134
2013-01-02     A         214

I've tried several alternatives using reshape2, data.tables (using table or count as FUN) and xts but I have been unable to obtain the desired results.

nrussell
  • 18,382
  • 4
  • 47
  • 60
Reflexes
  • 73
  • 5
  • 1
    http://stackoverflow.com/questions/7450600/count-number-of-observations-rows-per-group-and-add-result-to-data-frame – Chris Aug 12 '16 at 16:32
  • Thanks to both nrussell & Frank! I appologize for the duplication...I hadn't seen that thread! – Reflexes Aug 15 '16 at 12:54

0 Answers0