I have data frame:
station date classification
1 June - 01/16 A
2 June - 03/16 B
1 June - 01/16 A
7 June - 01/16 C
1 June - 03/16 A
2 June - 03/16 B
2 June - 03/16 B
I want to get the total number of occurrences of A, B and C, aggregated by the station # and date:
For example, station 1 on June 01 has 2 As, while station 2 on June 3 has 3 Bs.
I tried,
aggregate(x = list(data_frame$classification), by = list(station=data_frame$station, Date=data_frame$date), function(x) length(unique(x))