Learn R Programming

priceR (version 0.1.6)

historical_exchange_rates: 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

Run this code
# NOT RUN {
# Note date range >365 days', and returns 912 rows (as expected)
historical_exchange_rates("USD", to = "AUD", start_date = "2018-01-01", end_date = "2020-06-30")

historical_exchange_rates("USD", to = "AUD",
                          start_date = "2020-01-01", end_date = "2020-06-30")


historical_exchange_rates("AUD", to = "USD",
                          start_date = "2010-01-01", end_date = "2020-06-30")


historical_exchange_rates("AUD", to = "USD",
                          start_date = "2010-01-01", end_date = "2020-06-30")


# }
# NOT RUN {

# }

Run the code above in your browser using DataLab