get_current_exchangerate: Retrieves the current exchange rate for the given currency.

Description Usage Arguments Value See Also Examples

View source: R/endpoint_rates.R

Description

Retrieves the current exchange rate for the given currency.

Usage

1

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.

Value

nbp_api_response object containing the current exchange rate.

See Also

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

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

Examples

1
2
3
4
5
6
7
8
  tryCatch({
      ## Retrieve the current exchange rate for euros
      response <- get_current_exchangerate("A", "EUR")
      ## Retrieve the content
      response$content
    },
    error = function(e) message(e)
  )

rnbp documentation built on June 7, 2021, 9:07 a.m.