Exercise

Finding the largest group by county

tidyverse data wrangling tools in packages like dplyr and purrr are extremely powerful for exploring Census data. tidycensus is specifically designed with data exploration within the tidyverse in mind. For example, users might be interested in finding out the largest racial/ethnic group within each county for a given state. This can be accomplished using dplyr grouping capabilities, which allow users to identify the largest ACS group estimate and filter to retain the rows that match that group.

Instructions

100 XP
  • Group the ca_race dataset by the GEOID column.
  • Filter the dataset to retain those rows where the estimate value is equal to the maximum for its group (the county).
  • Use the tally() function to determine the breakdown of largest racial/ethnic groups for counties in California.