Learn R Programming

emoji (version 15.0)

emoji_replace: Replace emojis in a string

Description

Vectorised over string and replacement

Usage

emoji_replace(string, replacement)

emoji_replace_all(string, replacement)

Value

A character vector

Arguments

string

Input vector

replacement

A character vector of replacements. Should either be of length 1 or the same length as string. See stringr::str_replace() for details

Examples

Run this code
emoji_replace(emoji_name[1], "_emoji_")

string <- paste(c(letters[1:4], emoji_name[1:6]), collapse = " ")

emoji_replace_all(emoji_name[1:6], "_emoji_")

Run the code above in your browser using DataLab