Skip to contents

Extract Modifiers from Emojis

Usage

emoji_modifier_extract(x)

Arguments

x

Characters, vector of emojis.

Value

list of character vectors.

Details

This function is vectorized. See emoji_modifiers for full list of modified emojis and their unmodified state.

Examples

waving_hands <- emojis$emoji[grepl("waving hand", emojis$name)]
waving_hands
#> [1] "👋"   "👋🏻" "👋🏼" "👋🏽" "👋🏾" "👋🏿"

emoji_modifier_extract(waving_hands)
#> [[1]]
#> NULL
#> 
#> [[2]]
#> [1] "light skin tone"
#> 
#> [[3]]
#> [1] "medium-light skin tone"
#> 
#> [[4]]
#> [1] "medium skin tone"
#> 
#> [[5]]
#> [1] "medium-dark skin tone"
#> 
#> [[6]]
#> [1] "dark skin tone"
#> 

set.seed(1234)
emoji_sample <- sample(emojis$emoji, 10)
emoji_sample
#>  [1] "👨🏻‍⚕"                     "👩‍\U{01f9b3}"             
#>  [3] "👩🏾‍🤝‍👨🏼"                "🤦🏿"                     
#>  [5] "🇨🇼"                        "\U{01f9d1}🏼‍❤️‍\U{01f9d1}🏾"
#>  [7] "\U{01f9d6}‍♀"               "🦍"                       
#>  [9] "👩‍❤️‍💋‍👨"                   "🏋🏻‍♂"                     

emoji_modifier_extract(emoji_sample)
#> [[1]]
#> [1] "light skin tone"
#> 
#> [[2]]
#> [1] "white hair"
#> 
#> [[3]]
#> [1] "medium-dark skin tone"  "medium-light skin tone"
#> 
#> [[4]]
#> [1] "dark skin tone"
#> 
#> [[5]]
#> NULL
#> 
#> [[6]]
#> [1] "person"                 "person"                 "medium-light skin tone"
#> [4] "medium-dark skin tone" 
#> 
#> [[7]]
#> NULL
#> 
#> [[8]]
#> NULL
#> 
#> [[9]]
#> [1] "woman" "man"  
#> 
#> [[10]]
#> [1] "light skin tone"
#>