1. Обучение
  2. /
  3. Курса
  4. /
  5. Data Manipulation with dplyr

Connected

упражнение

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)

Инструкции 1/2

undefined XP
    1
    2
  • Summarize to find the total population, as a column called total_pop, in each combination of region and state, grouped in that order.