R can do pretty much everything, even visualize Leo's dating timeline
By: Stephan Teodosescu
If you're on the internet in any capacity you must have seen some version of the following post in the 24 hours, which originally came from the subreddit r/dataisbeautiful.
https://www.reddit.com/r/dataisbeautiful/comments/x20xfu/leonardo_dicaprio_has_split_with_camila_morrone/?utm_source=share&utm_medium=web2x&context=3
Reddit user TrustLittleBrother originally posted a chart depicting "Leo's Law" in 2019, and it racked up more than 26,200 upvotes at the time. The graph was updated this week1 after news of DiCaprio's split with his latest girlfriend, Argentine model and actress Camila Morrone, came to light.
https://www.reddit.com/r/dataisbeautiful/comments/azjti7/leonardo_dicaprio_refuses_to_date_a_woman_over_25/?utm_source=share&utm_medium=web2x&context=3
The original post shared on r/dataisbeautiful was made in Excel, but this being an R-centric blog, Tanya Shapiro's tweet on Wednesday showing how to make the same plot using ggplot caught my eye. Similar to the reddit post, her tweet predictably took off garnering more than 3,000 likes and 400 retweets within the first few hours of posting.
https://twitter.com/tanya_shapiro/status/1565029412428562433?s=20&t=OTuTi5ThNJRBqHqwIC0c2Q
Using Tanya's code2 as a base3 I remade the plot and altered it slightly to reflect updates since the 2019 original4.
The final result:
It was taken down at some point by Reddit's moderators as it violated their rules of no reposts of popular posts within a certain amount of time. The author rightfully griped about that rule, and fortunately for us the he pinned the updated version to his user profile so that we can see the data with Leo's latest heartbreak. It's this updated version that I attempted to recreate.
You should follow her on Twitter if you're into data visualization with the R programming language.
Specifically, I played around with the text sizing as it didn't come out as expected on my machine. In addition, the spacing between the girlfriend's first and last names looks a little funkier than on Tanya's graphic.
Code can be found on my GitHub.