Tests whether each element is a valid three-letter ISO 4217 currency code
(e.g. "USD", "eur"). Matching is case-insensitive.
Value
A logical vector the same length as x: TRUE where the value is a
valid ISO 4217 code, FALSE otherwise, NA where x is NA.
Details
A code-list lookup, not a syntactic check: "ZZZ" has the right
shape but is not a real code and returns FALSE.
See also
is_currency_symbol(), is_currency_code_symbol(), guess_data_type()
Other currency detectors:
is_currency_amount(),
is_currency_code_symbol(),
is_currency_symbol()
Examples
is_currency_code(c("USD", "eur", "ZZZ", NA))
#> [1] TRUE TRUE FALSE NA
#> TRUE TRUE FALSE NA