Learn R Programming

bbk (version 0.11.0)

nob_data: Fetch Norges Bank (NoB) data

Description

Retrieve time series data from the Norges Bank SDMX Web Service.

Usage

nob_data(
  flow,
  key = NULL,
  start_period = NULL,
  end_period = NULL,
  first_n = NULL,
  last_n = NULL
)

Value

A data.table::data.table() with the requested data.

Arguments

flow

(character(1))
The dataflow to query. See nob_metadata() for available dataflows.

key

(NULL | character(1))
The series key to query using dot-separated dimension values (e.g., "B.USD.NOK.SP"). Use + for multiple values in one dimension (e.g., "B.USD+EUR.NOK.SP"). If NULL, all data for the flow is returned. Default NULL.

start_period

(NULL | character(1) | integer(1))
Start date of the data (e.g., "2024-01-01" or 2024). If NULL, no start date restriction is applied. Default NULL.

end_period

(NULL | character(1) | integer(1))
End date of the data, in the same format as start_period. If NULL, no end date restriction is applied. Default NULL.

first_n

(NULL | numeric(1))
Number of observations to retrieve from the start of the series. If NULL, no restriction is applied. Default NULL.

last_n

(NULL | numeric(1))
Number of observations to retrieve from the end of the series. If NULL, no restriction is applied. Default NULL.

See Also

Other data: bbk_data(), bbk_series(), bde_data(), bde_latest(), bdf_codelist(), bdf_data(), bdf_dataset(), bdp_data(), bis_data(), boc_data(), boe_data(), boj_data(), cnb_czeonia(), cnb_data(), cnb_fx_other_rates(), cnb_fx_rates(), cnb_pribor(), ecb_data(), nbp_fx_rates(), nbp_gold(), onb_data(), snb_data(), srb_cross_rates(), srb_data()

Examples

Run this code
# \donttest{
# fetch USD/NOK exchange rate
nob_data("EXR", "B.USD.NOK.SP", last_n = 5L)

# fetch multiple exchange rates
nob_data("EXR", "B.USD+EUR+GBP.NOK.SP", start_period = "2024-01-01")

# fetch policy rate
nob_data("IR", last_n = 5L)
# }

Run the code above in your browser using DataLab