Generate an {emojiscape}

Animation of an RStudio window where the generate function from emojiscape is being used to render to the console a 10 by 10 grid of emoji with a city theme, followed by an undergrowth scene with a smaller grid size, followed by the printing of a dataframe showing the set of emoji associated with the liminal scene, which are a large white square, a door and a lightbulb.

tl;dr

You can print a little emoji scene to your R console with the {emojiscape} package.

Really?

Regular readers will know that this blog is where I implement whimsical R daydreams. Today is no exception: I’ve made a tiny package to print a little randomised emoji scene to my console.

Why? I’ve seen people make cute emoji-based bots, which I’ve been interested in after making the @londonmapbot Twitter bot (post, source, BotWiki). I also enjoyed the fun of mild randomisation in my last post about #RecreationThursday.

I’ve made this completely for my own amusement, so no guarantees whatsoever.

Play god

Install

You can install {emojiscape} from GitHub.

## remotes::install_github("matt-dray/emojiscape")
library(emojiscape)

The package has one dependency: the GitHub-hosted {emo} package1 by Hadley Wickham. It implements emoji in R like emo::ji("sauropod") πŸ¦•.

There’s no guarantee that these particular emoji will display correctly on your device and they may have different designs if you’re using another operating system.

Generate

Let’s generate() a scene.

The first one is nuts, lol: a classic deciduous woods.2

generate("woods")
## 🌳 🐿 🌰 🌰 🌳 🐿 🌰 🌳 🐿 🌰 
## 🌳 🐿 🌳 🌳 🌰 🌳 🌳 🌰 🌰 🌳 
## 🌳 🌰 🌳 🌳 🌳 🌳 🌰 🌳 🌳 🌳 
## 🌳 🌳 🌳 🌳 🌳 🌳 🌰 🌳 🌳 🌳 
## 🌳 🐿 🌳 🌰 🌳 🌰 🌳 🌳 🌳 🌳 
## 🌳 🌳 🐿 🌳 🌳 🌳 🌳 🌳 🌰 🌳 
## 🌰 🐿 🌰 🐿 🌳 🌳 🐿 🌳 🌳 🌳 
## 🌳 🌰 🌰 🌳 🌳 🌳 🌳 🌳 🌳 🌳 
## 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳 
## 🌳 🌳 🐿 🌳 🌳 🌳 🌳 🌳 🌰 🐿

Hold your breath, we’re going to space. You can resize the output, but space is basically infinite and my console is not.

generate(
  terrain = "space",
  grid_size = 7  # i.e. a 7x7 grid
)
## ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ 
## ⭐ ⬛ ⬛ ⬛ ⭐ ⬛ ⬛ 
## ⭐ ⭐ ⬛ ⭐ ⬛ ⬛ ⬛ 
## ⬛ ⬛ ⭐ ⬛ ⭐ ⬛ ⬛ 
## ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ 
## ⬛ ⬛ ⬛ ⭐ πŸ›° ⬛ ⬛ 
## ⬛ ⬛ ⭐ ⭐ ⬛ ⬛ ⭐

Here’s a little raccoon city. Perhaps the residents are evil. (That is a gamer joke, gg.)

generate("city", 5)
## 🏬 🏒 🏒 🏒 🏒 
## 🏒 🏬 🏬 🏒 🏒 
## 🏒 🏒 🏬 🏒 🏒 
## 🏒 🏒 🏒 🏬 🏒 
## 🏒 🏒 🦝 🏒 🏒

I have a PhD in dead leaves, so I had to add undergrowth. Ant you glad I included it?

generate("undergrowth", 5)
## πŸ‚ 🐜 πŸ‚ 🐜 πŸ‚ 
## 🐜 πŸ„ πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ 🐜 πŸ‚ 🐜 
## πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚

Here endeth the puns.

Terrains

So what are all the available terrain options?

paste(as.list(args(generate))$terrain)[-1]
##  [1] "arable"      "city"        "desert"      "forest"      "garden"     
##  [6] "liminal"     "mountains"   "ocean"       "pastoral"    "polar"      
## [11] "rainforest"  "sky"         "space"       "suburbs"     "traffic"    
## [16] "undergrowth" "woods"

This list may go out of date if more options are added in future.

Expand the sections below to see each terrain’s emoji set and previews of the output for each one.

Click for all emoji sets
## 
## terrain = "arable"
##   terrain        name emoji     freq
## 1  arable ear_of_corn    🌽   common
## 2  arable     tractor    🚜 uncommon
## 3  arable       mouse    🐭     rare
## 
## terrain = "city"
##   terrain             name emoji     freq
## 1    city  office_building    🏒   common
## 2    city department_store    🏬 uncommon
## 3    city          raccoon    🦝     rare
## 
## terrain = "desert"
##   terrain   name emoji     freq
## 1  desert desert     🏜   common
## 2  desert cactus    🌡 uncommon
## 3  desert  camel    🐫     rare
## 
## terrain = "forest"
##   terrain           name emoji     freq
## 1  forest evergreen_tree    🌲   common
## 2  forest       squirrel     🐿 uncommon
## 3  forest christmas_tree    πŸŽ„     rare
## 
## terrain = "garden"
##   terrain          name emoji     freq
## 1  garden          rose    🌹   common
## 2  garden      seedling    🌱 uncommon
## 3  garden wilted_flower    πŸ₯€     rare
## 
## terrain = "liminal"
##   terrain               name emoji     freq
## 1 liminal white_large_square    ⬜   common
## 2 liminal               door    πŸšͺ uncommon
## 3 liminal         light_bulb    πŸ’‘     rare
## 
## terrain = "mountains"
##     terrain                 name emoji     freq
## 1 mountains             mountain     β›°   common
## 2 mountains snow_capped_mountain     πŸ”οΈ uncommon
## 3 mountains                 goat    🐐     rare
## 
## terrain = "ocean"
##   terrain          name emoji     freq
## 1   ocean    water_wave    🌊   common
## 2   ocean desert_island     🏝 uncommon
## 3   ocean       dolphin    🐬     rare
## 
## terrain = "pastoral"
##    terrain           name emoji     freq
## 1 pastoral        rooster    πŸ“   common
## 2 pastoral            egg    πŸ₯š uncommon
## 3 pastoral hatching_chick    🐣     rare
## 
## terrain = "polar"
##   terrain            name emoji     freq
## 1   polar cloud_with_snow     🌨   common
## 2   polar       snowflake     ❄️ uncommon
## 3   polar         penguin    🐧     rare
## 
## terrain = "rainforest"
##      terrain           name emoji     freq
## 1 rainforest deciduous_tree    🌳   common
## 2 rainforest          snake    🐍 uncommon
## 3 rainforest        gorilla    🦍     rare
## 
## terrain = "sky"
##   terrain            name emoji     freq
## 1     sky cloud_with_rain     🌧   common
## 2     sky         rainbow    🌈 uncommon
## 3     sky        airplane     ✈️     rare
## 
## terrain = "space"
##   terrain               name emoji     freq
## 1   space black_large_square    ⬛   common
## 2   space               star    ⭐ uncommon
## 3   space              orbit     πŸ›°     rare
## 
## terrain = "suburbs"
##   terrain              name emoji     freq
## 1 suburbs    deciduous_tree    🌳   common
## 2 suburbs house_with_garden    🏑 uncommon
## 3 suburbs     person_biking    🚴     rare
## 
## terrain = "traffic"
##   terrain       name emoji     freq
## 1 traffic automobile    πŸš—   common
## 2 traffic       taxi    πŸš• uncommon
## 3 traffic      truck    🚚     rare
## 
## terrain = "undergrowth"
##       terrain        name emoji     freq
## 1 undergrowth fallen_leaf    πŸ‚   common
## 2 undergrowth         ant    🐜 uncommon
## 3 undergrowth    mushroom    πŸ„     rare
## 
## terrain = "woods"
##   terrain           name emoji     freq
## 1   woods deciduous_tree    🌳   common
## 2   woods       chestnut    🌰 uncommon
## 3   woods       chipmunk     🐿     rare
Click for all previews
## 
## terrain = "arable"
## 🌽 🌽 🌽 🌽 🌽 🌽 🌽 🚜 🌽 🌽 
## 🌽 🌽 🌽 🌽 🌽 🚜 🚜 🌽 🌽 🌽 
## 🚜 🌽 🌽 🌽 🌽 🌽 🌽 🚜 🌽 🚜 
## 🌽 🐭 🌽 🌽 🌽 🌽 🐭 🌽 🚜 🌽 
## 🌽 🌽 🚜 🌽 🌽 🌽 🌽 🐭 🌽 🌽 
## 🌽 🌽 🚜 🌽 🚜 🌽 🚜 🌽 🌽 🚜 
## 🌽 🌽 🌽 🚜 🌽 🌽 🐭 🌽 🌽 🐭 
## 🚜 🌽 🌽 🌽 🌽 🌽 🌽 🌽 🌽 🌽 
## 🌽 🌽 🌽 🌽 🚜 🌽 🌽 🌽 🌽 🌽 
## 🌽 🐭 🌽 🚜 🌽 🌽 🌽 🌽 🌽 🌽 
## 
## terrain = "city"
## 🏒 🏒 🏒 🏒 🏒 🏒 🏒 🏬 🏒 🏒 
## 🏒 🏒 🏒 🏒 🏒 🏒 🏒 🏒 🏒 🏒 
## 🏒 🏒 🏒 🏒 🏬 🏬 🏒 🏒 🏒 🏒 
## 🏒 🏒 🏒 🏒 🏒 🏒 🏬 🏒 🏬 🏒 
## 🏒 🏒 🏬 🏒 🏒 🏒 🏒 🏒 🦝 🏒 
## 🏒 🏒 🦝 🏬 🏒 🦝 🏒 🏬 🏒 🏒 
## 🏬 🏒 🏒 🏬 🏒 🏬 🏒 🏒 🏒 🦝 
## 🏒 🏒 🏒 🏬 🏒 🏒 🏬 🏬 🏒 🏒 
## 🏒 🏒 🏒 🏬 🏒 🏒 🏒 🏒 🦝 🏬 
## 🏒 🏬 🏬 🏒 🏒 🏒 🏒 🏒 🏒 🏒 
## 
## terrain = "desert"
## 🏜 🏜 🏜 🏜 🏜 🌡 🏜 🏜 🏜 🌡 
## 🏜 🏜 🏜 🏜 🏜 🏜 🌡 🏜 🏜 🏜 
## 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🌡 🏜 
## 🏜 🌡 🏜 🏜 🌡 🏜 🏜 🏜 🌡 🏜 
## 🏜 🏜 🏜 🏜 🏜 🏜 🌡 🐫 🏜 🏜 
## 🌡 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🌡 🏜 
## 🏜 🏜 🏜 🏜 🏜 🌡 🏜 🏜 🏜 🏜 
## 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🏜 🏜 
## 🏜 🏜 🏜 🐫 🏜 🌡 🌡 🏜 🌡 🏜 
## 🏜 🏜 🏜 🐫 🐫 🏜 🏜 🌡 🌡 🐫 
## 
## terrain = "forest"
## 🌲 🌲 🌲 🐿 🌲 🌲 🌲 🌲 πŸŽ„ 🌲 
## 🌲 🌲 🌲 🌲 🌲 🌲 🐿 🌲 🌲 🌲 
## 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 
## 🌲 🌲 🐿 🌲 🌲 🌲 🐿 🌲 🌲 🌲 
## 🐿 🌲 🌲 🌲 πŸŽ„ 🌲 🐿 🌲 🌲 πŸŽ„ 
## 🌲 🌲 🌲 🌲 🐿 🌲 🌲 πŸŽ„ 🌲 🌲 
## 🐿 🌲 🐿 🌲 πŸŽ„ 🌲 🐿 🌲 🐿 🌲 
## 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🐿 
## 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 
## 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🐿 🌲 
## 
## terrain = "garden"
## 🌱 🌹 🌹 🌹 🌱 🌹 🌹 🌹 🌹 🌱 
## 🌹 🌹 🌹 🌹 🌱 🌹 🌹 🌱 πŸ₯€ 🌹 
## 🌹 🌱 🌹 🌹 🌹 🌹 🌹 🌹 πŸ₯€ 🌱 
## πŸ₯€ 🌱 🌹 🌱 🌹 🌹 🌹 🌹 🌹 🌹 
## 🌱 πŸ₯€ 🌹 🌹 🌹 πŸ₯€ 🌹 🌹 🌱 🌹 
## 🌹 🌹 🌱 🌹 🌹 🌹 πŸ₯€ 🌹 🌹 🌹 
## 🌱 🌱 🌹 🌹 🌹 🌹 🌹 🌱 🌹 🌹 
## 🌹 🌹 🌱 🌹 🌹 🌹 🌹 🌹 🌱 🌹 
## 🌹 🌹 🌹 🌱 🌹 🌹 🌹 🌹 🌹 🌹 
## 🌱 🌹 🌱 🌹 🌹 🌹 🌹 🌹 🌹 🌱 
## 
## terrain = "liminal"
## ⬜ ⬜ ⬜ ⬜ ⬜ πŸšͺ ⬜ ⬜ ⬜ πŸšͺ 
## ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ πŸšͺ ⬜ ⬜ ⬜ 
## ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ πŸšͺ ⬜ 
## ⬜ ⬜ ⬜ ⬜ πŸšͺ ⬜ ⬜ ⬜ ⬜ ⬜ 
## ⬜ πŸšͺ ⬜ ⬜ πŸšͺ πŸšͺ ⬜ πŸšͺ ⬜ ⬜ 
## ⬜ πŸšͺ ⬜ ⬜ πŸ’‘ ⬜ ⬜ πŸšͺ ⬜ ⬜ 
## ⬜ πŸšͺ πŸšͺ πŸšͺ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ 
## ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ ⬜ πŸšͺ ⬜ ⬜ 
## ⬜ ⬜ πŸšͺ ⬜ πŸšͺ ⬜ πŸšͺ ⬜ ⬜ ⬜ 
## ⬜ πŸšͺ πŸšͺ ⬜ πŸšͺ ⬜ ⬜ ⬜ ⬜ ⬜ 
## 
## terrain = "mountains"
## β›° β›° β›° 🐐 β›° β›° πŸ”οΈ β›° β›° β›° 
## β›° β›° β›° πŸ”οΈ β›° β›° πŸ”οΈ β›° β›° β›° 
## β›° πŸ”οΈ β›° β›° πŸ”οΈ β›° β›° β›° β›° β›° 
## β›° β›° β›° β›° β›° β›° β›° β›° πŸ”οΈ β›° 
## β›° β›° β›° β›° β›° β›° 🐐 β›° β›° 🐐 
## β›° 🐐 πŸ”οΈ β›° β›° β›° β›° β›° πŸ”οΈ πŸ”οΈ 
## β›° β›° β›° πŸ”οΈ 🐐 β›° πŸ”οΈ πŸ”οΈ β›° β›° 
## β›° πŸ”οΈ 🐐 β›° β›° β›° β›° β›° β›° β›° 
## πŸ”οΈ β›° β›° β›° β›° πŸ”οΈ πŸ”οΈ β›° πŸ”οΈ 🐐 
## 🐐 πŸ”οΈ β›° β›° β›° β›° β›° πŸ”οΈ β›° πŸ”οΈ 
## 
## terrain = "ocean"
## 🐬 🌊 🏝 🏝 🌊 🌊 🌊 🌊 🌊 🌊 
## 🐬 🌊 🌊 🌊 🌊 🌊 🐬 🌊 🌊 🌊 
## 🌊 🌊 🌊 🌊 🌊 🌊 🏝 🏝 🌊 🌊 
## 🌊 🏝 🌊 🌊 🌊 🌊 🌊 🌊 🐬 🌊 
## 🌊 🌊 🌊 🏝 🌊 🌊 🌊 🌊 🌊 🌊 
## 🌊 🌊 🐬 🌊 🐬 🌊 🌊 🌊 🏝 🌊 
## 🌊 🏝 🏝 🌊 🌊 🏝 🌊 🌊 🌊 🌊 
## 🌊 🌊 🏝 🌊 🌊 🌊 🌊 🐬 🌊 🌊 
## 🏝 🌊 🌊 🏝 🌊 🐬 🌊 🌊 🏝 🌊 
## 🌊 🌊 🌊 🌊 🏝 🌊 🌊 🏝 🏝 🌊 
## 
## terrain = "pastoral"
## πŸ“ πŸ₯š πŸ₯š πŸ₯š πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 
## πŸ“ πŸ“ πŸ“ πŸ“ 🐣 πŸ“ πŸ₯š πŸ“ πŸ“ 🐣 
## πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 🐣 πŸ“ 
## πŸ“ πŸ“ πŸ₯š πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 🐣 
## πŸ“ 🐣 πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 
## πŸ₯š πŸ“ πŸ₯š πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 🐣 🐣 
## πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ₯š πŸ₯š πŸ“ 🐣 πŸ“ 
## πŸ“ πŸ“ πŸ“ πŸ₯š πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ πŸ“ 
## πŸ₯š πŸ“ πŸ“ πŸ“ πŸ₯š πŸ₯š πŸ₯š πŸ“ πŸ“ πŸ“ 
## πŸ₯š πŸ“ πŸ₯š πŸ₯š πŸ₯š 🐣 πŸ“ πŸ₯š πŸ“ πŸ₯š 
## 
## terrain = "polar"
## 🌨 ❄️ ❄️ 🌨 ❄️ 🌨 🌨 🌨 ❄️ 🌨 
## 🌨 🌨 🌨 🌨 🌨 🌨 ❄️ 🌨 🌨 🌨 
## 🌨 🌨 🐧 🌨 ❄️ 🐧 🌨 ❄️ ❄️ 🌨 
## ❄️ 🌨 🌨 🌨 🌨 🌨 ❄️ 🌨 ❄️ 🌨 
## 🌨 🌨 ❄️ 🐧 ❄️ ❄️ ❄️ 🌨 🌨 ❄️ 
## 🌨 🌨 🌨 🌨 🌨 ❄️ 🌨 🌨 🌨 ❄️ 
## 🌨 ❄️ 🌨 🌨 🌨 ❄️ 🌨 🌨 🌨 🌨 
## 🌨 🌨 🐧 ❄️ 🌨 ❄️ 🌨 🌨 ❄️ 🌨 
## 🌨 🌨 🌨 🌨 ❄️ 🌨 🌨 🌨 🌨 🌨 
## 🌨 ❄️ 🌨 🌨 🌨 🌨 🌨 🐧 ❄️ 🌨 
## 
## terrain = "rainforest"
## 🌳 🌳 🌳 🌳 🌳 🌳 🦍 🌳 🌳 🌳 
## 🌳 🐍 🐍 🐍 🌳 🦍 🌳 🌳 🌳 🌳 
## 🌳 🌳 🌳 🌳 🦍 🌳 🦍 🌳 🌳 🐍 
## 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🐍 🌳 🌳 
## 🌳 🌳 🐍 🦍 🌳 🌳 🌳 🐍 🌳 🐍 
## 🌳 🌳 🐍 🌳 🐍 🌳 🐍 🌳 🌳 🌳 
## 🌳 🌳 🌳 🌳 🐍 🌳 🌳 🌳 🌳 🌳 
## 🐍 🌳 🌳 🌳 🦍 🌳 🌳 🌳 🌳 🌳 
## 🌳 🌳 🦍 🌳 🌳 🌳 🌳 🐍 🌳 🐍 
## 🐍 🌳 🌳 🐍 🌳 🌳 🐍 🌳 🌳 🌳 
## 
## terrain = "sky"
## 🌧 🌧 🌧 🌧 🌧 🌧 🌧 🌧 🌈 🌈 
## 🌧 🌧 🌧 🌧 🌧 🌈 🌧 🌧 🌈 🌧 
## 🌧 🌧 🌈 🌧 ✈️ 🌧 🌧 🌧 🌧 ✈️ 
## 🌧 🌧 🌧 ✈️ 🌧 🌧 🌧 🌧 🌧 🌈 
## 🌧 🌧 🌧 🌧 🌈 🌧 🌧 🌧 🌧 🌧 
## 🌈 🌧 🌧 🌧 🌧 🌧 🌧 🌈 🌧 🌧 
## 🌧 🌈 🌧 🌧 🌧 🌧 🌧 🌧 🌧 🌧 
## 🌧 🌧 🌧 🌧 🌈 🌧 🌧 ✈️ 🌈 🌈 
## ✈️ 🌧 🌧 🌧 🌧 🌧 🌧 🌧 🌈 🌈 
## 🌈 🌧 🌧 🌧 🌧 🌧 🌈 🌧 🌈 🌧 
## 
## terrain = "space"
## ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⭐ 
## ⬛ ⬛ ⭐ ⬛ ⬛ ⬛ ⬛ ⭐ ⬛ ⬛ 
## ⬛ ⬛ ⬛ ⭐ ⭐ ⬛ ⭐ ⭐ ⬛ ⬛ 
## ⭐ ⬛ ⬛ ⭐ ⬛ πŸ›° ⬛ πŸ›° ⬛ ⭐ 
## ⬛ ⬛ ⬛ πŸ›° ⭐ ⬛ ⬛ πŸ›° ⬛ ⭐ 
## ⭐ ⬛ ⭐ ⬛ ⬛ ⬛ ⬛ ⬛ ⭐ ⬛ 
## ⬛ ⬛ ⭐ ⬛ ⬛ ⬛ ⬛ ⬛ ⬛ ⭐ 
## ⭐ ⭐ ⬛ ⬛ ⭐ ⬛ ⬛ ⬛ ⭐ ⬛ 
## ⬛ ⬛ ⬛ ⬛ ⭐ ⬛ ⬛ ⬛ ⭐ ⭐ 
## ⭐ ⬛ ⭐ ⬛ πŸ›° ⬛ ⬛ ⬛ ⬛ ⬛ 
## 
## terrain = "suburbs"
## 🌳 🌳 🏑 🌳 🌳 🌳 🌳 🌳 🌳 🌳 
## 🌳 🏑 🌳 🌳 🏑 🌳 🏑 🌳 🚴 🏑 
## 🌳 🌳 🏑 🌳 🌳 🏑 🌳 🌳 🌳 🌳 
## 🌳 🌳 🌳 🌳 🏑 🌳 🌳 🚴 🌳 🌳 
## 🌳 🌳 🏑 🏑 🌳 🏑 🌳 🏑 🌳 🌳 
## 🌳 🌳 🏑 🌳 🌳 🏑 🌳 🏑 🌳 🏑 
## 🌳 🏑 🌳 🏑 🌳 🌳 🏑 🏑 🌳 🏑 
## 🌳 🌳 🌳 🌳 🌳 🚴 🏑 🌳 🏑 🌳 
## 🌳 🌳 🌳 🚴 🌳 🌳 🌳 🏑 🌳 🌳 
## 🌳 🏑 🌳 🏑 🌳 🌳 🏑 🏑 🌳 🌳 
## 
## terrain = "traffic"
## πŸš— πŸš— πŸš— πŸš— πŸš• πŸš— πŸš— πŸš• πŸš— πŸš• 
## πŸš— πŸš— πŸš— πŸš— πŸš• πŸš— πŸš— 🚚 πŸš— πŸš— 
## πŸš— πŸš• πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— 
## πŸš— πŸš— 🚚 πŸš— πŸš— πŸš— πŸš— πŸš— πŸš• πŸš— 
## πŸš— πŸš— πŸš— πŸš— πŸš• πŸš— πŸš— πŸš— πŸš— πŸš— 
## πŸš— πŸš— 🚚 πŸš— πŸš— πŸš— πŸš• πŸš— πŸš• πŸš— 
## πŸš• πŸš— πŸš• πŸš— πŸš— πŸš— πŸš— πŸš• πŸš— πŸš• 
## πŸš• πŸš• πŸš• πŸš• πŸš— πŸš— πŸš• πŸš— πŸš— πŸš— 
## πŸš• πŸš• πŸš— πŸš— 🚚 πŸš— πŸš— πŸš— πŸš• πŸš— 
## πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— πŸš— 🚚 
## 
## terrain = "undergrowth"
## πŸ‚ 🐜 🐜 🐜 πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ 🐜 
## πŸ‚ 🐜 🐜 πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ 🐜 πŸ„ πŸ‚ 
## πŸ‚ πŸ„ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ 🐜 πŸ‚ 🐜 πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 
## πŸ‚ πŸ‚ πŸ‚ 🐜 πŸ„ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 🐜 
## 🐜 πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ πŸ‚ 
## 
## terrain = "woods"
## 🌳 🌳 🌳 🌰 🌰 🌳 🌳 🌳 🌳 🌳 
## 🌳 🌰 🌳 🌰 🌳 🌰 🌳 🌳 🌳 🌳 
## 🌳 🌰 🌰 🌳 🌳 🐿 🌳 🌳 🐿 🌳 
## 🌰 🌳 🌳 🌳 🌳 🌰 🌳 🌳 🌰 🌳 
## 🌰 🌳 🌰 🌳 🌳 🌳 🌳 🌳 🌳 🌰 
## 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌰 🌳 🌳 
## 🌳 🌳 🌳 🌳 🌳 🌳 🐿 🌰 🌳 🌳 
## 🌳 🌳 🌰 🌰 🌰 🌳 🌰 🌳 🌳 🌰 
## 🌳 🌳 🌰 🌰 🌳 🌳 🌳 🌳 🌳 🌰 
## 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳 🌳

Frequencies

Use get_set() to see each terrain’s emoji set and their β€˜suggested frequency’ slot. In general, the most common emoji is the one that defines the background or vegetation and the rarer ones are creatures or whatever.

get_set("mountains")
##     terrain                 name emoji     freq
## 1 mountains             mountain     β›°   common
## 2 mountains snow_capped_mountain     πŸ”οΈ uncommon
## 3 mountains                 goat    🐐     rare

But you can totally mess with these emoji sampling probabilities in generate().

Any The Mountain Goats fans?

generate(
  terrain = "mountains",
  prob_common = 0.1,
  prob_uncommon = 0.2,
  prob_rare = 0.7  # INCREASE GOAT FREQUENCY
)
## 🐐 πŸ”οΈ 🐐 β›° 🐐 🐐 🐐 πŸ”οΈ 🐐 🐐 
## πŸ”οΈ 🐐 β›° 🐐 🐐 🐐 🐐 πŸ”οΈ 🐐 🐐 
## 🐐 🐐 πŸ”οΈ 🐐 🐐 🐐 β›° 🐐 🐐 🐐 
## 🐐 🐐 🐐 🐐 β›° 🐐 🐐 πŸ”οΈ 🐐 🐐 
## 🐐 🐐 🐐 🐐 πŸ”οΈ 🐐 🐐 🐐 β›° 🐐 
## 🐐 🐐 🐐 🐐 πŸ”οΈ 🐐 πŸ”οΈ 🐐 🐐 🐐 
## πŸ”οΈ 🐐 β›° πŸ”οΈ 🐐 🐐 β›° 🐐 β›° 🐐 
## 🐐 🐐 🐐 β›° 🐐 β›° 🐐 πŸ”οΈ 🐐 πŸ”οΈ 
## πŸ”οΈ 🐐 🐐 🐐 🐐 🐐 πŸ”οΈ πŸ”οΈ πŸ”οΈ πŸ”οΈ 
## πŸ”οΈ πŸ”οΈ β›° 🐐 🐐 πŸ”οΈ 🐐 🐐 πŸ”οΈ 🐐

Approach

The generate() function is pretty simple. What it does is:

  1. Creates a vector of emojis with a length of grid_size() squared, sampled from the specified terrain set with frequencies from the prob_* arguments
  2. Coerces this vector to a matrix of length and width grid_size() (i.e.Β a square)
  3. Loops over each row of the matrix with cat() to print the output to the console

It works.

Expansion

If you really want, you can add a terrain option by raising a new issue or pull request in the {emojiscape} GitHub repo. These are specified in the .get_emoji() function in the /R/utils.R script.


Session info
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 4.1.0 (2021-05-18)
##  os       macOS Big Sur 10.16         
##  system   x86_64, darwin17.0          
##  ui       X11                         
##  language (EN)                        
##  collate  en_GB.UTF-8                 
##  ctype    en_GB.UTF-8                 
##  tz       Europe/London               
##  date     2021-06-26                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package     * version    date       lib source                     
##  assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.1.0)             
##  blogdown      1.3        2021-04-14 [1] CRAN (R 4.1.0)             
##  bookdown      0.22       2021-04-22 [1] CRAN (R 4.1.0)             
##  bslib         0.2.5.1    2021-05-18 [1] CRAN (R 4.1.0)             
##  cli           2.5.0      2021-04-26 [1] CRAN (R 4.1.0)             
##  crayon        1.4.1      2021-02-08 [1] CRAN (R 4.1.0)             
##  digest        0.6.27     2020-10-24 [1] CRAN (R 4.1.0)             
##  emo           0.0.0.9000 2021-06-23 [1] Github (hadley/emo@3f03b11)
##  emojiscape  * 0.0.0.9000 2021-06-26 [1] local                      
##  evaluate      0.14       2019-05-28 [1] CRAN (R 4.1.0)             
##  generics      0.1.0      2020-10-31 [1] CRAN (R 4.1.0)             
##  glue          1.4.2      2020-08-27 [1] CRAN (R 4.1.0)             
##  htmltools     0.5.1.1    2021-01-22 [1] CRAN (R 4.1.0)             
##  jquerylib     0.1.4      2021-04-26 [1] CRAN (R 4.1.0)             
##  jsonlite      1.7.2      2020-12-09 [1] CRAN (R 4.1.0)             
##  knitr         1.33       2021-04-24 [1] CRAN (R 4.1.0)             
##  lubridate     1.7.10     2021-02-26 [1] CRAN (R 4.1.0)             
##  magrittr      2.0.1      2020-11-17 [1] CRAN (R 4.1.0)             
##  purrr         0.3.4      2020-04-17 [1] CRAN (R 4.1.0)             
##  R6            2.5.0      2020-10-28 [1] CRAN (R 4.1.0)             
##  Rcpp          1.0.6      2021-01-15 [1] CRAN (R 4.1.0)             
##  rlang         0.4.11     2021-04-30 [1] CRAN (R 4.1.0)             
##  rmarkdown     2.9        2021-06-15 [1] CRAN (R 4.1.0)             
##  sass          0.4.0      2021-05-12 [1] CRAN (R 4.1.0)             
##  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.1.0)             
##  stringi       1.6.2      2021-05-17 [1] CRAN (R 4.1.0)             
##  stringr       1.4.0      2019-02-10 [1] CRAN (R 4.1.0)             
##  withr         2.4.2      2021-04-18 [1] CRAN (R 4.1.0)             
##  xfun          0.24       2021-06-15 [1] CRAN (R 4.1.0)             
##  yaml          2.2.1      2020-02-01 [1] CRAN (R 4.1.0)             
## 
## [1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

  1. In turn, {emo} is built on emojilib, which is where I got the emoji names in the form β€˜some_emoji’ for {emojiscape}.β†©οΈŽ

  2. Not to scale. Or, y’know, use your imagination.β†©οΈŽ