BISdata {BISdata}R Documentation

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://www.bis.org/statistics/",
              exdir = tempdir(),
              return.class = NULL,
              frequency = NULL,
              ...,
              header = TRUE,
              sep = ",",
              stringsAsFactors = FALSE,
              check.names = FALSE,
              na.strings = "",
              quote = "\"",
              fill = TRUE)

datasets(url = "https://www.bis.org/statistics/full_data_sets.htm", ...)

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(),
                          "full_bis_total_credit_csv.zip")

[Package BISdata version 0.2-2 Index]