Skip to contents

Insert Flag Emojis

Usage

flag(name, return_key = FALSE)

Arguments

name

Character denoting the place of the flag. Set return_key = TRUE to get full list of allowed names.

return_key

Logical, set to TRUE to get full list of allowed names.

Value

Character vector of emojis.

Details

This function is vectorized. The input is being normalized before matching which will hopefully lead to lower friction and easier matching. Punctuation is being removed and case is not taken into consideration when matching. You can run flag(return_key = TRUE) to get full list of allowed names.

Examples

flag(c("Vietnam", "Greenland", "Estonia", "Denmark", "united states"))
#> [1] "🇻🇳" "🇬🇱" "🇪🇪" "🇩🇰" "🇺🇸"

flag(c("US Virgin Islands", "U.S. Virgin Islands", "u.s. virgin islands"))
#> [1] "🇻🇮" "🇻🇮" "🇻🇮"