Learn R Programming

rnbp (version 0.2.2)

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

Description

Retrieves the current exchange rate for the given currency.

Usage

get_current_exchangerate(table, currency_code)

Value

nbp_api_response object containing the current exchange rate.

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.

See Also

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

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

Examples

Run this code
# \donttest{
tryCatch(
  {
    ## Retrieve the current exchange rate for euros
    response <- get_current_exchangerate("A", "EUR")
    ## Retrieve the content
    response$content
  },
  error = function(e) message(e)
)
# }

Run the code above in your browser using DataLab