I have a dataset in R, which includes IDs and no. of occurrences:
ID Occurrences
1001 A
1001 A
1001 B
1002 C
1002 A
1002 C
I would like to get the output as ID (unique) and occurrence (mode), like this:
ID Occurrences
1001 A
1002 C
How can I do this in R? I have tried something like "table" but I am not getting a proper answer.