IniziaInizia gratis

Counting by region

The counties dataset contains columns for region, state, population, and the number of citizens, which we selected and saved as the counties_selected table. In this exercise, you'll focus on the region column.

counties_selected <- counties %>%
  select(county, region, state, population, citizens)

Questo esercizio fa parte del corso

Data Manipulation with dplyr

Visualizza il corso

Istruzioni dell'esercizio

  • Use count() to find the number of counties in each region, using a second argument to sort in descending order.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# Use count to find the number of counties in each region
counties_selected %>%
  ___
Modifica ed esegui il codice