The currencies table contains information of currency codes and localized
display names and symbols across 574 locales. The
cldr_currencies() function allows one to extract a single element value
from the table by supplying the locale, the currency code (currency), and
one of the following element names:
"currency_symbol"
"currency_symbol_narrow"
"currency_display_name"
"currency_display_name_count_1"
"currency_display_name_count_other"
cldr_currencies(
locale = "en",
currency = currency_code_list$USD,
element = currencies_elements$currency_symbol
)A length one character vector.
The locale ID for which to obtain the data from the currencies table.
The currency code (e.g., "USD", "EUR", etc.). A valid set
of currency codes can be accessed through the currency_code_list object.
The element from which information will be obtained for the
specified locale. A valid set of currency elements can be accessed
through the currencies_elements list object.
If you would like to get the currency display name for the British Pound
("GBP") currency while in the "de" locale, the following invocation of
cldr_currencies() can be used.
cldr_currencies(
locale = "de",
currency = currency_code_list$GBP,
element = currencies_elements$currency_display_name
)
#> [1] "Britisches Pfund"