Tag: r count number of occurrences in column by group
Count by group in R using base, dplyr, and data.table
Here are multiple examples of how to count by group in R using base, dplyr, and data table capabilities. Dplyr might be the first choice to count by the group because it is relatively easy to adjust to specific needs. Meanwhile data.table is good for speed, and base R sometimes is good enough.