Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

info_currencies

View a table with info on supported currencies


Description

The fmt_currency() function lets us format numeric values as currencies. The table generated by the info_currencies() function provides a quick reference to all the available currencies. The currency identifiers are provided (name, 3-letter currency code, and 3-digit currency code) along with the each currency's exponent value (number of digits of the currency subunits). A formatted example is provided (based on the value of 49.95) to demonstrate the default formatting of each currency.

Usage

info_currencies(type = c("code", "symbol"), begins_with = NULL)

Arguments

type

The type of currency information provided. Can either be code where currency information corresponding to 3-letter currency codes is provided, or symbol where currency info for common currency names (e.g., dollar, pound, yen, etc.) is returned.

begins_with

Providing a single letter will filter currencies to only those that begin with that letter in their currency code. The default (NULL) will produce a table with all currencies displayed. This option only constrains the information table where type == "code".

Details

There are 172 currencies, which can lead to a verbose display table. To make this presentation more focused on retrieval, we can provide an initial letter corresponding to the 3-letter currency code to begins_with. This will filter currencies in the info table to just the set beginning with the supplied letter.

Value

An object of class gt_tbl.

Figures

Function ID

10-3

See Also

Examples

# Get a table of info on all of
# the currencies where the three-
# letter code begins with a "h"
tab_1 <- info_currencies(begins_with = "h")

# Get a table of info on all of the
# common currency name/symbols that
# can be used with `fmt_currency()`
tab_2 <- info_currencies(type = "symbol")

gt

Easily Create Presentation-Ready Display Tables

v0.2.2
MIT + file LICENSE
Authors
Richard Iannone [aut, cre] (<https://orcid.org/0000-0003-3925-190X>), Joe Cheng [aut], Barret Schloerke [aut] (<https://orcid.org/0000-0001-9986-114X>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.