ПочатиПочніть безкоштовно

Finding the year each name is most common

In an earlier video, you learned how to filter for a particular name to determine the frequency of that name over time. Now, you're going to explore which year each name was the most common.

To do this, you'll be combining the grouped mutate approach with a slice_max().

Ця вправа є частиною курсу

Data Manipulation with dplyr

Переглянути курс

Інтерактивна практична вправа

Спробуйте виконати цю вправу, доповнивши цей зразок коду.

# Calculate the fraction of people born each year with the same name
babynames %>%
  group_by(___) %>%
  mutate(___) %>%
  ungroup() %>%
  mutate(fraction = ___)
Редагувати та запускати код