Introduction to Emoji package

Taikgun Song

2017-10-28

When working with online text data such as twitter messages, Emoji Unicodes are often included as part of the data. Emoji characters are rich with underlying symbols, meanings, and expressions, but have been neglected in traditional text mining analysis.

The emoji package is capable of the following:

  1. Provide basic information of Emoji character given its Unicode.
  1. Plot image of the Emoji given its Unicode.

  2. Search Emoji based on keywords.

Data: emoji_v5.0

The data of the current package comes from Emoji List v5.0. The table from the web page is contained in data(emoji_v5.0). The data set consist of the following information:

library(emoji)
data("emoji_v5.0")
emoji

Extract Emoji Information with emoji_info()

The intention of the emoji package is to reflect the information of the Emoji while conducting text analysis. The package minizie the information loss by providing names, keywords, and categories of Emoji. While the previously listed data are basic materials provided by the Unicode Consortium, the package goes a step further by providing sentiment of the given Emoji unicode using the get_sentiment() function from the tidytext package. Also, the categories assigned by the Unicode Consortium is very limited, thus additional categories are implemented by the author. Function, emoji_info(), is the tool to derive the mentioned information.

Arguments

Results

Examples

emoji_info("U+1F600")
$name
[1] "grinning face"

$score
[1] "positive"

$categories
[1] "smileys_&_people" "face"             "positive"        

$categories2
[1] "expression"          "positive expression" "face"               
[4] "grin"               

attr(,"class")
[1] "list"       "emoji_info"
emoji_info("U+1F601", "afinn")
$name
[1] "beaming face with smiling eyes"

$score
[1] "2"

$categories
[1] "smileys_&_people" "face"             "positive"        

$categories2
[1] "expression"          "positive expression" "eye"                
[4] "face"                "grin"                "smile"              

attr(,"class")
[1] "list"       "emoji_info"

View Emoji with plot_emoji()

When Emoji is collected as text data, it is often saved as a code; mainly in “UTF-8”, but could be in other encoding formats. Considering that Emoji a pictogram, one can cast an image of a Emoji character by using plot_emoji() function.

Arguments

Results

Examples

emoji_plot("U+1F600")

Evaluate a single character string with Emoji via emoji_info_table()

Arguments

Results

Examples

a_string="Obviously #hateher  U+1f495  U+1f60f  U+1f469  @ Los Angeles, California https://www.instagram.com/p/BCbPSxxGVua/"
emoji_info_table(a_string)
# A tibble: 3 x 6
  uni_code count          name    score                      categories
     <chr> <int>         <chr>    <chr>                           <chr>
1  U+1F469     1         woman  neutral        smileys_&_people, person
2  U+1F495     1    two hearts positive       smileys_&_people, emotion
3  U+1F60F     1 smirking face  neutral smileys_&_people, face, neutral
# ... with 1 more variables: categories2 <chr>
emoji_info_table(a_string, "afinn")
# A tibble: 3 x 6
  uni_code count          name score                      categories
     <chr> <int>         <chr> <chr>                           <chr>
1  U+1F469     1         woman              smileys_&_people, person
2  U+1F495     1    two hearts     3       smileys_&_people, emotion
3  U+1F60F     1 smirking face       smileys_&_people, face, neutral
# ... with 1 more variables: categories2 <chr>

Future Works