This function lets the user download historical currency exchange rate between two currencies.
get_currency(
currency_pair,
from = Sys.Date() - 99,
to = Sys.Date(),
fill = FALSE
)
Character. Which currency exchange do you wish to get the history from? i.e, USD/COP, EUR/USD...
Date. From date
Date. To date
Boolean. Fill weekends and non-quoted dates with previous values?
data.frame. Result of fetching online data for currency_pair
grouped by date.
# NOT RUN {
# For today (or any one single date)
get_currency("USD/COP", from = Sys.Date())
# For multiple dates
get_currency("EUR/USD", from = Sys.Date() - 7, fill = TRUE)
# }
Run the code above in your browser using DataLab