Get startedGet started for free

Finding the most popular names each year

You saw that you could use filter() and arrange() to find the most common names in one year. However, you could also use group_by() and slice_max() to find the most common name in every year.

This exercise is part of the course

Data Manipulation with dplyr

View Course

Exercise instructions

  • Use group_by() and slice_max() to find the most common name for US babies in each year.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

babynames %>%
  # Find the most common name in each year
  ___
  
Edit and Run Code