Aan de slagGa gratis aan de slag

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)

Deze oefening maakt deel uit van de cursus

Data Manipulation with dplyr

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

counties_selected %>%
  # Group and summarize to find the total population
  ___
  
Code bewerken en uitvoeren