Created
February 4, 2017 12:56
-
-
Save RobertMyles/5c4e5a4131ce13d3a478abbcacc642df to your computer and use it in GitHub Desktop.
little script to see what emojis are available with the emojifont package in R.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rvest) | |
library(stringr) | |
library(emojifont) | |
library(tidyverse) | |
url <- "http://www.webpagefx.com/tools/emoji-cheat-sheet/" | |
page <- read_html(url) | |
nodes <- html_nodes(page, css = "#content") | |
text <- html_text(nodes) | |
txt <- data_frame(label = unlist(str_extract_all(text, ":[a-z_]*:"))) %>% | |
mutate(label = gsub(":", "", label)) | |
txt <- txt %>% | |
mutate(emoji_code = NA) | |
for(i in 1:nrow(txt)){ | |
try(txt$emoji_code[i] <- emoji(txt$label[i])) | |
} | |
txt <- txt %>% | |
filter(!is.na(emoji_code)) | |
knitr::kable(txt, format = "markdown") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment