A tidy toolkit for working with the emoji in any text column, such
as social-media posts, product reviews, chat logs or survey responses.
Unicode is awkward to handle and not every code point is an emoji, which
makes emoji statistics fiddly to obtain. 'tidyEmoji' extracts, counts,
categorises, sentiment-scores and emotion-scores emoji, converts them to and
from text (for accessibility and NLP preprocessing), searches the emoji
catalogue, maps emoji co-occurrence and sequences (graph-ready edge lists
and n-grams), measures where and how densely emoji are used, and builds
document-by-emoji feature tables for machine learning, with grapheme-aware
detection (so skin-tone and multi-person sequences stay intact), returning
tidy data frames that slot straight into a 'tidyverse' workflow. It also
quantifies how much annotators disagreed about an emoji (interpretation
risk), extracts the words around each emoji, tracks emoji use over time,
measures text-emoji sentiment mismatch, and applies explicit
emoji-preprocessing policies for language-model pipelines. Its emoji
catalogue is the Unicode emoji test data, bundled and current to Emoji
18.0, so it can also say what a glyph is, map flag emoji to ISO 3166
codes, report how much of a corpus each lexicon can score, and read
reaction tallies as well as text. The
bundled emoji sentiment lexicon is from the Emoji
Sentiment Ranking of Kralj Novak et al. (2015)

Count, score, translate and relate the emoji in any text column, and get tidy data frames back.
library(tidyEmoji)
reviews <- data.frame(text = c("Best purchase ever \U0001f600\U0001f60d",
"It broke after a day \U0001f621",
"Does the job.",
"Shipped to \U0001f1ef\U0001f1f5 in two days \U0001f680"))
emoji_frequency(reviews, text)
#> # A tibble: 5 × 5
#> emoji name shortcode group n
#> <chr> <chr> <chr> <chr> <int>
#> 1 🇯🇵 flag: Japan jp Flags 1
#> 2 😀 grinning face grinning Smileys & Emotion 1
#> 3 😍 smiling face with heart-eyes heart_eyes Smileys & Emotion 1
#> 4 😡 enraged face rage Smileys & Emotion 1
#> 5 🚀 rocket rocket Travel & Places 1
emoji_sentiment(reviews, text)
#> # A tibble: 4 × 4
#> text .emoji_n .emoji_n_scored .emoji_sentiment
#> <chr> <int> <int> <dbl>
#> 1 Best purchase ever 😀😍 2 2 0.625
#> 2 It broke after a day 😡 1 1 -0.173
#> 3 Does the job. 0 NA NA
#> 4 Shipped to 🇯🇵 in two days 🚀 2 1 0.525
How much of that could the lexicon score? One more call says so:
emoji_coverage(reviews, text)[, c("lexicon", "occurrence_coverage",
"n_rows_unscored")]
#> # A tibble: 2 × 3
#> lexicon occurrence_coverage n_rows_unscored
#> <chr> <dbl> <int>
#> 1 novak2015 0.8 0
#> 2 emotag1200 0.6 1
install.packages("tidyEmoji")library(tidyEmoji)emoji_summary(df, text)vignette("introduction", package = "tidyEmoji")| Question | Verbs |
|---|---|
| How much emoji is here, and which? | emoji_summary(), emoji_frequency(), emoji_tokens() |
| What does it say? | emoji_sentiment(), emoji_emotion(), emoji_coverage() |
| Will readers agree on it? | emoji_ambiguity(), emoji_risk() |
| What is this glyph, exactly? | emoji_properties(), emoji_identical(), emoji_find() |
| What goes with what? | emoji_pairs(), emoji_collocations(), emoji_ngrams() |
| When, and how new? | emoji_trend(), emoji_adoption_lag() |
| Which countries do the flags name? | emoji_country(), emoji_flag() |
| Reaction counts rather than text? | emoji_from_counts() |
| Sending text to a language model? | emoji_sanitize(), emoji_token_cost() |
presentation = "any", which every counting and scoring verb takes.emoji_coverage() next to any lexicon score: it says how much
of the corpus the score covers.emoji_provenance() into a methods section: it records the
Unicode catalogue (Emoji 18.0, bundled) and the lexicons behind a
result.Three articles ship with the package: vignette("introduction") for a
full analysis of a real corpus, vignette("reversible-preprocessing")
for emoji in language-model pipelines, and vignette("emoji-networks")
for co-occurrence networks. All three are on the package
website.