Extract Modifiers from Emojis
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] "π€·π½ββ" "π©πΎβπ¦°" "ποΈββ" "ππΎββ" "β‘"
#> [6] "π§πΎβπ€βπ§π»" "π§πΌββββ‘" "π¨πΎββ€βπβπ¨πΏ" "π€Έπ»ββ" "ππΌββββ‘"
emoji_modifier_extract(emoji_sample)
#> [[1]]
#> [1] "medium skin tone"
#>
#> [[2]]
#> [1] "medium-dark skin tone" "red hair"
#>
#> [[3]]
#> NULL
#>
#> [[4]]
#> [1] "medium-dark skin tone"
#>
#> [[5]]
#> NULL
#>
#> [[6]]
#> [1] "medium-dark skin tone" "light skin tone"
#>
#> [[7]]
#> [1] "medium-light skin tone"
#>
#> [[8]]
#> [1] "man" "man" "medium-dark skin tone"
#> [4] "dark skin tone"
#>
#> [[9]]
#> [1] "light skin tone"
#>
#> [[10]]
#> [1] "medium-light skin tone"
#>