Site icon R-bloggers

The Bachelorette Eps. 6, 7 & 8 – Suitors to the Occasion – Data and Drama in R

[This article was first published on Stoltzman Consulting Data Analytics Blog - Stoltzman Consulting, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Winners and Losers

In a similar manner to the last post, it took 3 more episodes for me to be able to muster up the courage to write a blog post. The drama level has, as usual, hit an all time high. However, we are going to take a look at what it means to be a contestant in terms of Instagram followers once you leave the show.

Here’s a chart showing the followers of all contestants (scaled for comparison purposes) and you’ll notice the pink line changes to gray when the person gets the big ugly axe.

There’s an obvious pattern that stands out. As soon as you’re kicked off the show, those instagram follower curves flatten out. While this would be expected, it’s incredibly drastic. The major outlier here is Dale Moss (however, he left without being kicked off).

The moral of the story is…

If you’re going to make a living by becoming a social media Instagram influencer that peddles garbage products for cash, you need to keep those roses flowing.

Fun with R

I wanted to showcase those numbers in a table with a fun R table. Using the {kableExtra} package I was able to download all user images, run some basic calculations on their followers at the start of their careers to if/when they were kicked off up until today. It’s a crazy long table as one might assume, but it’s a great feature.

# Code for the table

insta_changes %>%
  mutate(pic = '') %>%
  mutate(followers_at_start = scales::number(followers_at_start, accuracy = 1, big.mark = ','), 
         followers_at_departure = scales::number(followers_at_departure, accuracy = 1, big.mark = ','), 
         followers_latest = scales::number(followers_latest, accuracy = 1, big.mark = ',')) %>% 
  select(` ` = pic, Name = name, Status = status, Start = followers_at_start, Departure = followers_at_departure, Latest = followers_latest, `% Change` = change_latest_pct) %>%
  kbl(booktabs = TRUE, longtable = TRUE, align = 'c') %>%
  kable_styling(latex_options = c("hold_position", "repeat_header"), bootstrap_options = c('striped')) %>%
  kable_paper(full_width = FALSE) %>%
  column_spec(1, image = spec_image(insta_changes$pic_filename, 200, 200))


To leave a comment for the author, please follow the link and comment on their blog: Stoltzman Consulting Data Analytics Blog - Stoltzman Consulting.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.