शुरू करेंमुफ़्त में शुरू करें

Biggest jumps in a name

Previously, you added a ratio column to describe the ratio of the frequency of a baby name between consecutive years to describe the changes in the popularity of a name. Now, you'll look at a subset of that data, called babynames_ratios_filtered, to look further into the names that experienced the biggest jumps in popularity in consecutive years.

babynames_ratios_filtered <- babynames_fraction %>%
                     arrange(name, year) %>%
                     group_by(name) %>%
                     mutate(ratio = fraction / lag(fraction)) %>%
                     filter(fraction >= 0.00001)

यह अभ्यास पाठ्यक्रम का हिस्सा है

Data Manipulation with dplyr

पाठ्यक्रम देखें

अभ्यास निर्देश

  • From each name in the data, keep the observation (the year) with the largest ratio; note the data is already grouped by name.
  • Sort the ratio column in descending order.
  • Filter the babynames_ratios_filtered data further by filtering the fraction column to only display results greater than or equal to 0.001.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

babynames_ratios_filtered %>%
  # Extract the largest ratio from each name 
  ___
  # Sort the ratio column in descending order 
  ___
  # Filter for fractions greater than or equal to 0.001
  ___
कोड संपादित करें और चलाएँ