download_emoji {WhatsR}R Documentation

Scraping a dictionary of emoji from https://www.unicode.org/

Description

Scrapes a dictionary of emoji from https://www.unicode.org/, assuming that the website is available and its structure does not change. Can be used to update the emoji dictionary contained in this package by replacing the file and recompiling the package. The dictionary is ordered according to the length of the emojis' byte representation (longer ones first) to prevent partial matching of shorter strings when iterating through the data frame.

Usage

download_emoji(
  unicode_page = "https://www.unicode.org/Public/emoji/15.1/emoji-test.txt",
  delete_header = 32,
  nlines = -1L
)

Arguments

unicode_page

URL to the unicode page containing the emoji dictionary.

delete_header

Number of lines to delete from the top of the file.

nlines

Number of lines to read from the file. Passed to readLines as n. Negative Integers will read all lines.

Value

A data frame containing:
1) The native representation (glyphs) of all emoji in R
2) A textual description of what the emoji is displaying
3) The hexadecimal codepoints of the emoji
4) The status of the emoji (e.g. "fully-qualified" or "component")
5) Original order of the .txt file that the emoji were fetched from

Examples

Emoji_dictionary <- download_emoji(nlines = 50)

[Package WhatsR version 1.0.4 Index]