rdb_series: Download list of series for datasets of DBnomics providers.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rdb_series.R

Description

rdb_series downloads the list of series for available datasets of a selection of providers from DBnomics.
/!\ We warn the user that this function can be (very) long to execute. We remind that DBnomics requests data from 63 providers to retrieve 21675 datasets for a total of approximately 720 millions series.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
rdb_series(
  provider_code = NULL,
  dataset_code = NULL,
  dimensions = NULL,
  query = NULL,
  use_readLines = getOption("rdbnomics.use_readLines"),
  curl_config = getOption("rdbnomics.curl_config"),
  simplify = FALSE,
  verbose = FALSE,
  ...
)

Arguments

provider_code

Character string (default NULL). DBnomics code of one or multiple providers. If NULL, the providers are firstly dowloaded with the function rdb_providers and then the datasets are requested.

dataset_code

Character string (default NULL). DBnomics code of one or multiple datasets of a provider. If NULL, the datasets codes are dowloaded with the function rdb_datasets and then the series are requested.

dimensions

List or character string (single quoted) (default NULL). DBnomics code of one or several dimensions in the specified provider and dataset. If it is a named list, then the function toJSON (from the package jsonlite) is applied to generate the json object.

query

Character string (default NULL). A query to filter/select series from a provider's dataset.

use_readLines

Logical (default FALSE). If TRUE, then the data are requested and read with the base function readLines i.e. through the default R internet connection. This can be used to get round the error Could not resolve host: api.db.nomics.world.

curl_config

Named list (default NULL). If not NULL, it is used to configure a proxy connection. This configuration is passed to the function curl_fetch_memory of the package curl. A temporary curl_handle object is created internally with arguments equal to the provided list in curl_config.
For curl_fetch_memory arguments see curl_fetch. For available curl options see curl_options, names(curl_options()) and libcurl.

simplify

Logical (default FALSE). If TRUE, when the series are requested for only one provider and one dataset then a data.table is returned, not a nested named list of data.tables.

verbose

Logical (default FALSE). Show number of series per datasets and providers.

...

Additionals arguments.

Details

By default, the function returns a nested named list of data.tables containing the series of datasets for providers from DBnomics.

Value

A nested named list of data.tables or a data.table.

Author(s)

Sebastien Galais

See Also

rdb_providers, rdb_last_updates, rdb_datasets, rdb_dimensions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")

## With dimensions
rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-country` = "AGO"))
rdb_series("IMF", "WEO:2019-10", dimensions = list(`weo-subject` = "NGDP_RPCH"), simplify = TRUE)

## With query
rdb_series("IMF", "WEO:2019-10", query = "ARE")
rdb_series("IMF", c("WEO:2019-10", "WEOAGG:2019-10"), query = "NGDP_RPCH")

rdb_series(provider_code = "IMF", verbose = TRUE)

options(rdbnomics.progress_bar_series = TRUE)
rdb_series(provider_code = "IMF", dataset_code = "WEO:2019-10")
options(rdbnomics.progress_bar_series = FALSE)

rdb_series(
  provider_code = "IMF", dataset_code = "WEO:2019-10",
  use_readLines = TRUE
)

rdb_series(
  provider_code = "IMF", dataset_code = "WEO:2019-10",
  curl_config = list(proxy = "<proxy>", proxyport = <port>)
)

## End(Not run)

rdbnomics documentation built on Oct. 26, 2020, 1:06 a.m.