New sports from random emoji
Nov 25, 2017
2 minute read

I love emoji ❤️ and I love xkcd, so this recent comic from Randall Munroe was quite a delight for me.

I sat there, enjoying the thought of these new sports like horse hole and multiplayer avocado and I thought, “I can make more of these in just the barest handful of lines of code”. This is largely thanks to the emo package by Hadley Wickham, which if you haven’t installed and started using yet, WHY NOT??? 😱

emoji_sports <- function(n) {
    data <- dplyr::sample_n(emo::jis, n)
    emo::ji_glue(paste(dplyr::pull(data, emoji),
                       collapse = ""))
}

This function uses the jis dataset from the emo package, sample a few of them, and then prints them out in a R Markdown document, which is what I use to blog. Let’s make some!

🤵🏼🤕🙅🏿‍♂️

Excellent. This new sport is a head injury formalwear competition; it’s judged very strictly.

🇸🇳🙏🙍🏿‍♀️

Here we see the new sport of being thankful for Senegalese culture.

⭐️🐣🔪

This new sport is a scary one, where stars are awarded to the baby chicks with the best knife-throwing skills.

Some of the sports in the xkcd comic have only two characters, and we can make those as well.

🤷🏻🏃🏻‍♂️

Ah yes, we’ll soon all be enjoying the sport of running long distances for no understandable reason. I think some of you probably already enjoy this sport.

Or we can generate lots with purrr.

library(purrr)

map(sample(c(2,3), 10, replace = TRUE),
    emoji_sports)
## [[1]]
## 🕝️👷🏼‍♀️ 
## 
## [[2]]
## 🚕🧘🏿‍♀️🧕🏾 
## 
## [[3]]
## ⚾🤞🏾 
## 
## [[4]]
## 👂🏿🔈️🤷🏻‍♂️ 
## 
## [[5]]
## 👳🏿☃✡ 
## 
## [[6]]
## 🕸️🕟️🤚🏻 
## 
## [[7]]
## 🇧🇷🛃 
## 
## [[8]]
## 🧝🏾‍♂️🛌🏽🦅 
## 
## [[9]]
## ☂↘️✋ 
## 
## [[10]]
## 🎖️💂🏿‍♂️

Some of those emojis aren’t printing quite as well, but there are definitely some winners (timed spiderweb fingerknitting and the like).

I could keep going all day, but I’ll wrap it up here. 👋 Let me know if you have any questions!



comments powered by Disqus