convert: Convert a currency into another currency.

Description Usage Arguments Value

Description

Convert a currency into another currency.

Usage

1
convert(amount, from = "USD", to = "USD", as_of = NULL)

Arguments

amount

numeric. The amount to convert.

from

character. The currency code to convert from. Defaults to USD.

to

character. The currency code to convert to. Defaults to USD.

as_of

character. The time of conversion to use for calculating the exchange rate. latest or today or NULL uses the most recent rate (default). Otherwise, one can enter in a string in "yyyy-mm-dd" format (e.g., "2004-01-30") to get the historical exchange rate as of that time. Only dates on or after 2000-01-01 are supported.

Value

the amount in the converted currency.


peterhurford/currencyr documentation built on May 25, 2019, 1:50 a.m.