historical_exchange_rates {priceR} | R Documentation |
Retrieve historical exchange rates
Description
Retrieves historical exchange rates between a currency pair
Usage
historical_exchange_rates(from, to, start_date, end_date)
Arguments
from |
A currency code (see currencies() for supported codes) |
to |
A currency code |
start_date |
A start date (of the form "2010-01-01") |
end_date |
An end date |
Value
A data.frame containing exchange rate data for select currency pair
Examples
## Not run:
Retrieve AUD to USD exchange rates
au <- historical_exchange_rates(from = "AUD", to = "USD",
start_date = "2010-01-01", end_date = "2020-06-30")
# Retrieve AUD to EUR exchange rates
ae <- historical_exchange_rates(from = "AUD", to = "EUR",
start_date = "2010-01-01", end_date = "2020-06-30")
# Combine
cur <- au %>% left_join(ae, by = "date")
head(cur)
## End(Not run)
[Package priceR version 1.0.1 Index]