The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Type: Package
Title: Download Data from the Bank for International Settlements (BIS)
Version: 0.2-3
Date: 2024-05-01
Maintainer: Enrico Schumann <es@enricoschumann.net>
Description: 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.
Suggests: zoo
License: GPL-3
URL: https://enricoschumann.net/R/packages/BISdata/ , https://git.sr.ht/~enricoschumann/BISdata , https://github.com/enricoschumann/BISdata
LazyLoad: yes
ByteCompile: yes
NeedsCompilation: no
Packaged: 2024-05-01 15:10:17 UTC; es19
Author: Enrico Schumann ORCID iD [aut, cre]
Repository: CRAN
Date/Publication: 2024-05-01 16:02:18 UTC

Download Data from the Bank for International Settlements (BIS)

Description

Download datasets from the Bank for International Settlements (BIS) and convert to data frames.

Usage

fetch_dataset(dest.dir, dataset,
              bis.url = "https://data.bis.org/static/bulk/",
              exdir = tempdir(),
              return.class = NULL,
              frequency = NULL,
              ...,
              header = TRUE,
              sep = ",",
              stringsAsFactors = FALSE,
              check.names = FALSE,
              na.strings = "",
              quote = "\"",
              fill = TRUE)

datasets(url = "https://data.bis.org/bulkdownload", ...)

Arguments

dest.dir

file path: where to store the files?

dataset

the name of the file

bis.url

the base url

url

the url from which to fetch information about the datasets

exdir

file path: where to unzip?

return.class

NULL or character: currently, only zoo is supported

frequency

string, or nothing (NULL)

...

passed on to read.table

header, sep, stringsAsFactors, check.names, na.strings, quote, fill

passed on to read.table

Details

Supported are full datasets (typically) in CSV format. Downloaded data may optionally be cached, to avoid repeated downloads of the same files.

If the download fails with an error, then both functions will return NULL. For fetch_dataset, if the download failed with a warning from download.file, then the function will evaluate to the return value of download.file.

Value

typically a data.frame.

bis_datasets returns a data.frame with three columns:

filename

the dataset filename

description

a brief description of the dataset

updated

if available, the date when the dataset was last updated

Author(s)

Enrico Schumann

Examples


## (Internet connection required)
datasets()
bis.data <- fetch_dataset(dest.dir = tempdir(),
                          "WS_CBPOL_csv_col.zip")

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.