Skip to content

enricoschumann/BISdata

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
R
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 
 
 

BISdata

Functions for downloading data from the Bank for International Settlements (BIS; https://www.bis.org/) in Basel. Supported are only full datasets in (typically) CSV format. The package is lightweight and without dependencies; suggested packages are used only if data is to be transformed into particular data structures, for instance into ‘zoo’ objects. Downloaded data can optionally be cached, to avoid repeated downloads of the same files.

Installation

To install the package from a running R session, type:

install.packages('BISdata',
                 repos = c('http://enricoschumann.net/R', 
                           getOption('repos')))

or clone/build the GitHub version.

Examples

datasets

Fetch a list of all datasets.

library("BISdata")
datasets()
                                           filename                                                                                description    updated
1                         full_bis_lbs_diss_csv.zip                                                        Locational banking statistics (CSV) 2021-10-27
2                              full_bis_cbs_csv.zip                                                      Consolidated banking statistics (CSV) 2021-10-27
3                        full_bis_debt_sec2_csv.zip                                                           Debt securities statistics (CSV) 2021-09-20
4                     full_bis_total_credit_csv.zip                                                   Credit to the non-financial sector (CSV) 2021-09-20
5         full_webstats_credit_gap_dataflow_csv.zip                                                                   Credit-to-GDP gaps (CSV) 2021-09-20
6                              full_bis_dsr_csv.zip                             Debt service ratios for the private non-financial sector (CSV) 2021-09-20
7                              full_bis_gli_csv.zip                                                          Global liquidity indicators (CSV) 2021-10-27
8                              full_bis_xtd_csv.zip                                               Exchange-traded derivatives statistics (CSV) 2021-09-20
9                              full_bis_otc_csv.zip                                                          OTC derivatives outstanding (CSV) 2021-11-15
10       full_webstats_xru_current_dataflow_csv.zip                             US dollar exchange rates (monthly, quarterly and annual) (CSV) 2021-11-17
11 full_webstats_xru_current_d_dataflow_csv_col.zip                               US dollar exchange rates (daily, horizontal time axis) (CSV) 2021-11-17
12 full_webstats_xru_current_d_dataflow_csv_row.zip                                 US dollar exchange rates (daily, vertical time axis) (CSV) 2021-11-17
13                             full_bis_eer_csv.zip                                            Effective exchange rate indices (monthly) (CSV) 2021-11-17
14         full_webstats_eer_d_dataflow_csv_col.zip                        Effective exchange rate indices (daily, horizontal time axis) (CSV) 2021-11-17
15         full_webstats_eer_d_dataflow_csv_row.zip                          Effective exchange rate indices (daily, vertical time axis) (CSV) 2021-11-17
16                             full_BIS_DER_csv.zip                                              Triennial Survey statistics on turnover (CSV) 2019-12-08
17                     full_bis_selected_pp_csv.zip                                                     Property prices: selected series (CSV) 2021-08-26
18                         full_bis_long_pp_csv.zip Property prices: long series (CSV) (from May 2019, updated in the selected series dataset)       <NA>
19                              full_bis_rb_csv.zip                             Payments and financial market infrastructures statistics (CSV) 2021-03-25
20                        full_bis_rb_sdmx_ml21.zip                     Payments and financial market infrastructures statistics (SDMX-ML 2.1) 2021-03-25
21          full_webstats_long_cpi_dataflow_csv.zip                                                                      Consumer prices (CSV) 2021-10-28
22           full_webstats_cbpol_m_dataflow_csv.zip                                                               Policy rates (monthly) (CSV) 2021-11-17
23       full_webstats_cbpol_d_dataflow_csv_col.zip                                           Policy rates (daily, horizontal time axis) (CSV) 2021-11-17
24       full_webstats_cbpol_d_dataflow_csv_row.zip                                             Policy rates (daily, vertical time axis) (CSV) 2021-11-17

fetch_dataset

Fetch a particular dataset.

data <- fetch_dataset(dest.dir = "~/Downloads/BIS",
                      dataset = "full_bis_total_credit_csv.zip")
str(data)
'data.frame':   1133 obs. of  339 variables:
 $ FREQ              : chr  "Q" "Q" "Q" "Q" ...
 $ Frequency         : chr  "Quarterly" "Quarterly" "Quarterly" "Quarterly" ...
 $ BORROWERS_CTY     : chr  "4T" "4T" "4T" "4T" ...
 $ Borrowers' country: chr  "Emerging market economies (aggregate)"  ...
 $ TC_BORROWERS      : chr  "C" "C" "C" "G" ...
 $ Borrowing sector  : chr  "Non financial sector" "Non financial sector"  ...
 $ TC_LENDERS        : chr  "A" "A" "A" "A" ...
 $ Lending sector    : chr  "All sectors" "All sectors" "All sectors" "All sectors" ...
 $ VALUATION         : chr  "M" "M" "M" "N" ...
 $ Valuation         : chr  "Market value" "Market value" "Market value" "Nominal value" ...
 $ UNIT_TYPE         : chr  "770" "799" "USD" "770" ...
 $ Unit type         : chr  "Percentage of GDP" "Percentage of GDP (using PPP exchange rates)" ...
 $ TC_ADJUST         : chr  "A" "A" "A" "A" ...
 $ Type of adjustment: chr  "Adjusted for breaks" "Adjusted for breaks" ...
 $ Time Period       : chr  "Q:4T:C:A:M:770:A" "Q:4T:C:A:M:799:A" "Q:4T:C:A:M:USD:A" ...
 $ 1940-Q2           : num  NA NA NA NA NA NA NA NA NA NA ...
 $ 1940-Q3           : num  NA NA NA NA NA NA NA NA NA NA ...
 $ 1940-Q4           : num  NA NA NA NA NA NA NA NA NA NA ...
 $ 1941-Q1           : num  NA NA NA NA NA NA NA NA NA NA ...
 $ 1941-Q2           : num  NA NA NA NA NA NA NA NA NA NA ...
 $ 1941-Q3           : num  NA NA NA NA NA NA NA NA NA NA ...
## ....
 $ 2017-Q3           : num  196.4 178.6 53645 50.4 48.3 ...
 $ 2017-Q4           : num  198.4 180.5 55857.1 51 49.1 ...
 $ 2018-Q1           : num  200.5 178.5 58616.2 51.6 48.7 ...
 $ 2018-Q2           : num  188.2 179.8 56539.5 48.5 49.6 ...
 $ 2018-Q3           : num  184.2 181 55717.4 47.8 50.5 ...
 $ 2018-Q4           : num  187.8 181.2 56927.6 49.2 50.8 ...
 $ 2019-Q1           : num  197.8 182.5 59666.9 51.6 50.7 ...
 $ 2019-Q2           : num  199.2 183.1 60127.3 52.6 51.3 ...
 $ 2019-Q3           : num  194.6 185.4 59244.3 51.7 52.6 ...
 $ 2019-Q4           : num  200.9 186.9 61777.3 53.6 53.3 ...
 $ 2020-Q1           : num  200.4 193.6 60906.7 52.8 54.7 ...
 $ 2020-Q2           : num  215.1 203.4 63401.2 57.6 58.6 ...
 $ 2020-Q3           : num  227.3 209 66627.7 61.6 61.2 ...
 $ 2020-Q4           : num  239.5 211.2 70888.6 66.3 63.2 ...
 $ 2021-Q1           : num  235.5 209.5 72400.9 65.2 62.7 ...

Transform data into zoo.

library("zoo")
data <- fetch_dataset(dest.dir = "~/Downloads/BIS",
                      dataset = "full_bis_total_credit_csv.zip",
                      return.class = "zoo")
summary(data)
    Index      Q:4T:C:A:M:770:A Q:4T:C:A:M:799:A
Min.   :1940   Min.   :109.7    Min.   :113.8   
1st Qu.:1960   1st Qu.:122.2    1st Qu.:118.8   
Median :1981   Median :141.9    Median :137.8   
Mean   :1981   Mean   :151.9    Mean   :146.2   
3rd Qu.:2001   3rd Qu.:185.2    3rd Qu.:174.7   
Max.   :2021   Max.   :239.5    Max.   :211.2   
               NA's   :246      NA's   :246     

Q:4T:C:A:M:USD:A Q:4T:G:A:N:770:A Q:4T:G:A:N:799:A
Min.   : 6821    Min.   :30.90    Min.   :33.90   
1st Qu.:13173    1st Qu.:38.00    1st Qu.:38.10   
Median :29868    Median :40.60    Median :40.30   
Mean   :31788    Mean   :43.69    Mean   :43.68   
3rd Qu.:46650    3rd Qu.:49.20    3rd Qu.:48.70   
Max.   :72401    Max.   :66.30    Max.   :63.20   
NA's   :246      NA's   :271      NA's   :271     

## ....

About

Download datasets from BIS https://www.bis.org/

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages