Skip to contents

This function converts ISO3 country codes to country names in a specified language.

Usage

iso3_to_name(x, lang = "en")

Arguments

x

A character vector of ISO3 country codes.

lang

A character string specifying the language for the country names. Default is "en" (English), alternatives include "fr" (French).

Value

A character vector of country names corresponding to the provided ISO3 codes.

Details

The function uses a reference data frame country_ref that contains ISO3 codes and their corresponding country names in multiple languages. The data come from the countries package.

Examples

iso3_to_name(c("USA", "FRA", "DEU"))
#> [1] "United States of America" "France"                  
#> [3] "Germany"