Skip to contents

uses a simple Regular Expression (RegEx) to clear most emojis from the text variable. Attempts to handle emojis which are joined together - like family emojis, and 'edited emojis' like those with skin tones etc. set

Usage

limpiar_remove_emojis(data, text_var = mention_content)

Arguments

data

Name of your Data Frame or Tibble object

text_var

Name of your text variable. Can be given as a 'string' or a symbol - should refer to a column inside data

Value

Data Frame with the text variable cleaned in place

Examples


 emojis <- data.frame(
 text = c("Hello πŸ‘‹ World",
  "Family: πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦",
  "Coding πŸ‘¨πŸ½β€πŸ’»",
  "Flags πŸ³οΈβ€πŸŒˆ πŸ‡ΊπŸ‡Έ",
  "Weather β˜€οΈ β›ˆοΈ ❄️")
)

emojis
#>               text
#> 1   Hello πŸ‘‹ World
#> 2 Family: πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦
#> 3    Coding πŸ‘¨πŸ½β€πŸ’»
#> 4     Flags πŸ³οΈβ€πŸŒˆ πŸ‡ΊπŸ‡Έ
#> 5    Weather β˜€οΈ β›ˆοΈ ❄️

# using limpiar_remove_emojis() to remove them entirely:
limpiar_remove_emojis(emojis, text)
#>           text
#> 1 Hello  World
#> 2     Family: ‍‍‍
#> 3      Coding ‍
#> 4      Flags ‍ 
#> 5   Weather