I have a dataframe that looks like the following:
df<-data.frame(group=c("A","A","B"))
What's the simplest way of adding another column to this that has the count of each occurrence of the column group?
The result should look like the following:
group count
1 A 2
2 A 2
3 B 1