get_exchangerate_from_interval {rnbp}R Documentation

Retrieves the exchange rates from a specific interval.

Description

Retrieves the exchange rates from a specific interval.

Usage

get_exchangerate_from_interval(table, currency_code, from, to)

Arguments

table

specifies which from which table the exchange rate should be fetched.

currency_code

code of the currency for which the exchange rate should be fetched.

from

start day of the interval.

to

end day of the interval.

Details

As exchange rates are not published on the weekends fetching values from an interval containing a weekend will result in a response that omits those days.

Value

nbp_api_response object containing the exchange rates from the specified interval.

See Also

https://api.nbp.pl/#kursyWalut

Other rates: get_current_exchangerate(), get_exchangerate_from(), get_last_n_exchangerates(), get_todays_exchangerate()

Examples



  tryCatch({
      ## Fetch the exchange rate table from the past week
      response <- get_exchangerate_tables_from_interval("A", Sys.Date() - 7, Sys.Date())
      ## Preview response content
      response$content
    },
    error = function(e) message(e)
  )



[Package rnbp version 0.2.1 Index]