Summarizing by state and region
You can group by multiple columns instead of grouping by one. Here, you'll practice aggregating by state and region, and notice how useful it is for performing multiple aggregations in a row.
counties_selected <- counties %>%
select(region, state, county, population)
This exercise is part of the course
Data Manipulation with dplyr
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
counties_selected %>%
# Group and summarize to find the total population
___