emoji_faceness() reports the share of a row's emoji that are faces. Face
emoji act as emotional signals and object emoji as semantic ones, and the
two have measurably different effects on engagement, so the split is worth a
column of its own.
Arguments
- data
A data frame or tibble containing a text column. Grouped data frames are accepted. The verbs that work a row at a time (adding columns, or keeping and expanding rows) carry the grouping through to their result, as
dplyr::mutate()anddplyr::filter()do. The verbs that pool across rows – the counts, the co-occurrence edge lists, the time series – warn that they ignore the grouping and return one corpus-wide answer.- text
The text column to scan, supplied unquoted. Any atomic column is accepted and read as character, so a
factorworks and a numeric,Dateor logical one simply contains no emoji. A list column – or a data-frame column – is refused rather than coerced, because coercing one deparses it and the emoji found would be in the code rather than in your data. What counts as an emoji is the same in every verb; see the Detection section of tidyEmoji for the one case that surprises people, code points that are emoji only when they carryU+FE0F.
Value
data, as a tibble, with added columns .emoji_n,
.emoji_n_typed (emoji whose type is known), .emoji_n_face and
.emoji_faceness (.emoji_n_face / .emoji_n_typed). Rows with no emoji
get NA.
.emoji_n_typed distinguishes the two ways a share can be missing, as
.emoji_n_scored does in emoji_sentiment(): 0 means the row had
emoji whose type the recode does not know, NA that it had no emoji at
all. .emoji_faceness is NA in both cases – a share of no typable
emoji is not 0, it is unknown – so read the count before the share. See
emoji_type() for when a glyph can be untypable.
Examples
df <- data.frame(text = c("\U0001f600\U0001f355", "\U0001f600", "none"))
emoji_faceness(df, text)
#> # A tibble: 3 × 5
#> text .emoji_n .emoji_n_typed .emoji_n_face .emoji_faceness
#> <chr> <int> <int> <int> <dbl>
#> 1 😀🍕 2 2 1 0.5
#> 2 😀 1 1 1 1
#> 3 none 0 NA NA NA