knitr::opts_chunk$set( collapse = TRUE, comment = "", fig.path = "man/figures/README-", out.width = "100%" ) library(emojiscape) set.seed(1337)
{emojiscape} is a tiny R package that prints to the console a randomised emoji scene. Choose a terrain and three emoji of that theme will be sampled with different probabilities and rendered to a grid size of your choosing.
Install {emojiscape} from GitHub. It requires the GitHub-hosted {emo} package, which is built on emojilib.
remotes::install_github("matt-dray/emojiscape")
I made this for my own amusement, so no guarantees.
You can generate()
a scene by passing one of the recognised terrain
options.
emojiscape::generate("city")
You can see the emoji set for each terrain. I've categorised them into 'common', 'uncommon' and 'rare' emoji based on what their default sampling frequency.
emojiscape::get_set("city")
You can adjust these frequencies with the prob_*
arguments in generate()
. You can also change the grid_size()
of the output.
emojiscape::generate( terrain = "city", grid_size = 7, # i.e. a 7x7 grid prob_common = "0.2", prob_uncommon = "0.2", prob_rare = "0.6" )
The full set of terrain options is:
terrain_options <- paste(as.list(args(generate))$terrain)[-1] print(terrain_options)
Click for a preview of all terrains
print_scape <- function(terrain) { cat(paste0('\nterrain = "', terrain, '"\n')) emojiscape::generate(terrain) } purrr::walk(terrain_options, print_scape)
Click for all emoji sets
print_scape <- function(terrain) { cat(paste0('\nterrain = "', terrain, '"\n')) print(emojiscape::get_set(terrain)) } purrr::walk(terrain_options, print_scape)
You can raise a new issue or pull request to add a terrain, which are specified in /R/utils.R. Please note that the emojiscape project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.