Looks up the daily USD/EUR exchange rate via an API call for the specified date range.

eurusds(date_from, date_to, last_x_days = NULL)

Arguments

date_from

The start of the range.

date_to

The end of the range.

last_x_days

Return the exchange rates for the last X days compared to date_to.

Format

Returns a data.table.

  • date: The day for which the exchange rate was valid.

  • exchange_rate: Daily exchange rate.

Value

Returns the daily exchange rates.

See also

Examples

# Specific date range eurusds("2019-05-01", "2019-05-24")
#> date exchange_rate #> 1: 2019-05-02 0.8919015 #> 2: 2019-05-03 0.8964590 #> 3: 2019-05-06 0.8929369 #> 4: 2019-05-07 0.8940545 #> 5: 2019-05-08 0.8926977 #> 6: 2019-05-09 0.8934155 #> 7: 2019-05-10 0.8904720 #> 8: 2019-05-13 0.8892841 #> 9: 2019-05-14 0.8907892 #> 10: 2019-05-15 0.8942144 #> 11: 2019-05-16 0.8926180 #> 12: 2019-05-17 0.8950949 #> 13: 2019-05-20 0.8954957 #> 14: 2019-05-21 0.8959771 #> 15: 2019-05-22 0.8951750 #> 16: 2019-05-23 0.8977467 #> 17: 2019-05-24 0.8938947
# Last 45 days from a specific date eurusds(date_to = "2019-05-01", last_x_days = 45)
#> date exchange_rate #> 1: 2019-03-18 0.8811349 #> 2: 2019-03-19 0.8804367 #> 3: 2019-03-20 0.8807469 #> 4: 2019-03-21 0.8781944 #> 5: 2019-03-22 0.8847992 #> 6: 2019-03-25 0.8830022 #> 7: 2019-03-26 0.8856611 #> 8: 2019-03-27 0.8880206 #> 9: 2019-03-28 0.8914245 #> 10: 2019-03-29 0.8900757 #> 11: 2019-04-01 0.8899964 #> 12: 2019-04-02 0.8928571 #> 13: 2019-04-03 0.8894423 #> 14: 2019-04-04 0.8913450 #> 15: 2019-04-05 0.8902341 #> 16: 2019-04-08 0.8892051 #> 17: 2019-04-09 0.8867607 #> 18: 2019-04-10 0.8866034 #> 19: 2019-04-11 0.8877841 #> 20: 2019-04-12 0.8833142 #> 21: 2019-04-15 0.8839388 #> 22: 2019-04-16 0.8845644 #> 23: 2019-04-17 0.8848774 #> 24: 2019-04-18 0.8888889 #> 25: 2019-04-23 0.8892841 #> 26: 2019-04-24 0.8921402 #> 27: 2019-04-25 0.8990380 #> 28: 2019-04-26 0.8982305 #> 29: 2019-04-29 0.8968610 #> 30: 2019-04-30 0.8914245 #> date exchange_rate
# Last 45 days from today eurusds(last_x_days = 45)
#> date exchange_rate #> 1: 2019-04-17 0.8848774 #> 2: 2019-04-18 0.8888889 #> 3: 2019-04-23 0.8892841 #> 4: 2019-04-24 0.8921402 #> 5: 2019-04-25 0.8990380 #> 6: 2019-04-26 0.8982305 #> 7: 2019-04-29 0.8968610 #> 8: 2019-04-30 0.8914245 #> 9: 2019-05-02 0.8919015 #> 10: 2019-05-03 0.8964590 #> 11: 2019-05-06 0.8929369 #> 12: 2019-05-07 0.8940545 #> 13: 2019-05-08 0.8926977 #> 14: 2019-05-09 0.8934155 #> 15: 2019-05-10 0.8904720 #> 16: 2019-05-13 0.8892841 #> 17: 2019-05-14 0.8907892 #> 18: 2019-05-15 0.8942144 #> 19: 2019-05-16 0.8926180 #> 20: 2019-05-17 0.8950949 #> 21: 2019-05-20 0.8954957 #> 22: 2019-05-21 0.8959771 #> 23: 2019-05-22 0.8951750 #> 24: 2019-05-23 0.8977467 #> 25: 2019-05-24 0.8938947 #> 26: 2019-05-27 0.8930166 #> 27: 2019-05-28 0.8934954 #> 28: 2019-05-29 0.8963786 #> 29: 2019-05-30 0.8981498 #> 30: 2019-05-31 0.8967806 #> date exchange_rate