MulaiMulai sekarang secara gratis

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)

Latihan ini adalah bagian dari kursus

Data Manipulation with dplyr

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

counties_selected %>%
  # Group and summarize to find the total population
  ___
  
Edit dan Jalankan Kode