Skip to contents

emoji_frequency() counts how often each emoji appears across the whole text column (an entry containing the same emoji twice contributes 2) and returns a tibble sorted by descending count, with each emoji's name, shortcode and category.

Usage

emoji_frequency(data, text)

Arguments

data

A data frame or tibble containing a text column.

text

The text column to scan, supplied unquoted.

Value

A tibble with columns emoji, name, shortcode, group and n, sorted by descending n with ties broken by the glyph so the order is deterministic.

See also

top_n_emojis() for just the most frequent emoji.

Examples

df <- data.frame(text = c("\U0001f600\U0001f600", "\U0001f621"))
emoji_frequency(df, text)
#> # A tibble: 2 × 5
#>   emoji name          shortcode group                 n
#>   <chr> <chr>         <chr>     <chr>             <int>
#> 1 😀    grinning face grinning  Smileys & Emotion     2
#> 2 😡    enraged face  rage      Smileys & Emotion     1