Retrieve time series data from the BIS SDMX Web Service.
Usage
bis_data(
flow,
key = NULL,
start_period = NULL,
end_period = NULL,
first_n = NULL,
last_n = NULL
)Arguments
- flow
(
character(1))
The dataflow to query. Seebis_metadata()for available dataflows.- key
(
NULL|character())
The series keys to query using dot-separated dimension values (e.g.,"M.CH"). Use+for multiple values in one dimension (e.g.,"M.CH+US"). IfNULL, all data for the flow is returned. DefaultNULL.- start_period
(
NULL|character(1)|integer(1))
Start date of the data. Supported formats:YYYY for annual data (e.g.,
2019)YYYY-S[1-2] for semi-annual data (e.g.,
"2019-S1")YYYY-Q[1-4] for quarterly data (e.g.,
"2019-Q1")YYYY-MM for monthly data (e.g.,
"2019-01")YYYY-MM-DD for daily data (e.g.,
"2019-01-01")
If
NULL, no start date restriction is applied (data retrieved from the earliest available date). DefaultNULL.- end_period
(
NULL|character(1)|integer(1))
End date of the data, in the same format as start_period. IfNULL, no end date restriction is applied (data retrieved up to the most recent available date). DefaultNULL.- first_n
(
NULL|numeric(1))
Number of observations to retrieve from the start of the series. IfNULL, no restriction is applied. DefaultNULL.- last_n
(
NULL|numeric(1))
Number of observations to retrieve from the end of the series. IfNULL, no restriction is applied. DefaultNULL.
Value
A data.table::data.table() with the requested data.
Examples
# \donttest{
# fetch Swiss central bank policy rate
bis_data("WS_CBPOL", "M.CH", last_n = 5L)
#> Warning: Undefined namespace prefix [1219]
#> Null data.table (0 rows and 0 cols)
# fetch effective exchange rates
bis_data("WS_EER", "M.N.B.CH", start_period = "2020-01")
#> Warning: Undefined namespace prefix [1219]
#> Null data.table (0 rows and 0 cols)
# }