Session Ready
Exercise

Adding the total and maximum for each name

In the video, you learned how you could group by the year and use mutate() to add a total for that year.

In these exercises, you'll learn to normalize by a different, but also interesting metric: you'll divide each name by the maximum for that name. This means that every name will peak at 1.

Once you add new columns, the result will still be grouped by name. This splits it into 48,000 groups, which actually makes later steps like mutates slower.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Use a grouped mutate to add two columns:
    • name_total, with the total number of babies born with that name in the entire dataset.
    • name_max, with the highest number of babies born in any year.