get_currency: Download Historical Currency Exchange Rate

Description Usage Arguments Value Examples

View source: R/currency.R

Description

This function lets the user download historical currency exchange rate between two currencies.

Usage

1
2
3
4
5
6
get_currency(
  currency_pair,
  from = Sys.Date() - 99,
  to = Sys.Date(),
  fill = FALSE
)

Arguments

currency_pair

Character. Which currency exchange do you wish to get the history from? i.e, USD/COP, EUR/USD...

from

Date. From date

to

Date. To date

fill

Boolean. Fill weekends and non-quoted dates with previous values?

Value

data.frame. Result of fetching online data for currency_pair grouped by date.

Examples

1
2
3
4
# 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)

lares documentation built on June 9, 2021, 9:06 a.m.