Returns a data.frame with the latest exchange rate(s) for the given currencies. Default will convert to USD ($).
Arguments
- from,
default =
NULLA character string representing the base currency (e.g., "USD"). The user must providefromvalues with one of the following method :passing a paired character list, e.g., c("EUR" = "USD", "RON" = "EUR") ;
or passing one or several
fromvalues :associated with a single
tovalue, e.g.,from = c('EUR', "RON"), to = "USD"or associated with a list of
fromvalues of the same length, e.g.,from = c('EUR', "RON"), to = c("USD", "EUR").
- to,
default =
"USD"A character string representing the target currencies, e.g.,c("EUR", "USD").- .verbose
logicalIf TRUE, messages are displayed, e.g., when invalid symbols are detected. Default is FALSE.- ...
(internal use : the user have
get_changes_historic()to passrangeandintervalparameters)
Value
The returned data.frame contains daily exchange rates, and the following columns:
- currency
character- The base currency.- symbol
character- The Yahoo Finance symbol (e.g., "EURUSD=X").- exchangename
character- The exchange place name, i.e. 'CCY' for currencies.- intrumenttype
character- The type of financial instrument, supposed to be 'CURRENCY'.- firsttradedate
POSIXct- The oldest date available on the Yahoo Finance API for an exchange rates historic.- gmtoffset
numeric- The difference with GMT time (seconds).- timezone
character- The market's timezone.- exchangetimezonename
character- The name of the market's timezone, e.g., 'Europe/London'.- regularmarketprice
numeric- The latest market price.- regularmarketdayhigh
numeric- The market highest price of this day.- regularmarketdaylow
numeric- The market lowest price of this day.- fiftytwoweekhigh
numeric- The highest price in the last 52 weeks.- fiftytwoweeklow
numeric- The lowest price in the last 52 weeks.- previousclose
numeric- The last closing price.- regular_timezone
character- The regular market's timezone.- from
character- The currency converted, exchange rate is a value of 1 of this currency against another currency.- to
character- The currency exchanged back in return: most of the currency-relatednumericvalues of the row are expressed with this currency.- timestamp
POSIXct- The corresponding date (YYYY-MM-DD).
Details
Return a data.frame with additional attributes:
- n.currencies
integer- Number of unique currencies in thedata.frame.- currencies
character- A vector of currency symbols in thedata.frame(e.g.,"BTC","ETH","USD").- exchange
character- A vector of exchange pairs (e.g.,"BTC => USD"). If not applicable,NULL(no entry).- date.fetch
Date- The date when the data was retrieved, set usingSys.Date().- crypto
logical-TRUEif cryptocurrencies are present, otherwiseFALSE.- date.begin
POSIXct- The oldest observation in the dataset.- date.end
POSIXct- The most recent observation in the dataset.- date.dif
numeric- The number of seconds between date.begin and date.end, equivalent ofdifftimevalue.
See also
For more details on currencies-related functions, see:
vignette("currencies", package = "financr")
