Counting by multiple groups — sometimes called crosstab reports — can be a useful way to look at data ranging from public opinion surveys to medical tests. For example, how did people vote by gender and age group? How many software developers who use both R and Python are men vs. women?
There are a lot of ways to do this kind of counting by categories in R. Here, I’d like to share some of my favorites.
For the demos in this article, I’ll use a subset of the Stack Overflow Developers survey, which surveys developers on dozens of