Session Ready
Exercise

We have a winner!

In this exercise, we will identify an important metric — who is the user who has published the tweet with the most retweets?

This kind of information is important when you are doing social media analysis: it will give you information about the most "famous" tweet of your dataset. This can help, in the future, to establish what are the key themes and users for a specific theme/hashtag.

We will use purrr to extract the most retweeted tweet from our corpus, and see who is the user behind this tweet. As we want this analysis to be run on original tweets only, we have provided you the non_rt list, which was created in a previous exercise.

Instructions
100 XP
  • Extract all the "retweet_count" elements with the appropriate map_*() variant. Pass it to max().

  • Prefill a map_at(), with .at being "retweet_count" and the .f being a mapper that tests for equality to max_rt.

  • Map this new function on non_rt, keep the "retweet_count" only, and flatten the result.

  • Print the $screen_name and $text of the result to the console.