Learn R Programming

tidyBdE (version 0.2.4)

bde_series_load: Load a single BdE time-series.

Description

The series alias is a positional code showing the location (column and/or row) of the series in the table. However, although it is unique, it is not a good candidate to be used as the series ID, as it is subject to change. If a series changes position in the table, its alias will also change.

To ensure series can still be identified, even after these changes, they are assigned a sequential number (series_code on this function) which will remain unchanged throughout the series' lifetime.

Note that a single series could be used on different tables, so it can have several aliases. If you need to search by alias it is recommended to use bde_series_full_load().

Usage

bde_series_load(
  series_code,
  series_label = NULL,
  parse_dates = TRUE,
  parse_numeric = TRUE,
  cache_dir = NULL,
  update_cache = FALSE,
  verbose = FALSE,
  extract_metadata = FALSE
)

Arguments

series_code

a numeric (or coercible with base::as.double() value or vector with time-series code(s), as defined in the field N<U+00FA>mero secuencial of the corresponding series. See bde_catalog_load().

series_label

Optional. Character vector or value. Allows to specify a custom label for the series extracted. It should have the same length than series_code.

parse_dates

Logical. If TRUE the dates would be parsed using bde_parse_dates().

parse_numeric

Logical. If TRUE the columns would be parsed to double (numeric) values. See Note.

cache_dir

A path to a cache directory. The directory can also be set via options with options(bde_cache_dir = "path/to/dir").

update_cache

Logical. If TRUE the requested file would be updated on the cache_dir.

verbose

Logical TRUE or FALSE, display information useful for debugging.

extract_metadata

Logical TRUE/FALSE. On TRUE the output is the metadata of the requested series.

Value

A tibble with a field "Date" and the series_code of the series as described on the catalogs. See bde_catalog_load().

Details

Load a single time-series provided by BdE.

See Also

bde_catalog_load(), bde_catalog_search(), bde_indicators()

Other series: bde_series_full_load()

Examples

Run this code
# NOT RUN {
# Metadata
bde_series_load(573234, verbose = TRUE, extract_metadata = TRUE)

# Data
bde_series_load(573234, extract_metadata = FALSE)

# Vectorized
bde_series_load(c(573234, 573214),
  series_label = c("US/EUR", "GBP/EUR"),
  verbose = TRUE, extract_metadata = TRUE
)

bde_series_load(c(573234, 573214),
  series_label = c("US/EUR", "GBP/EUR"),
  verbose = TRUE, extract_metadata = FALSE
)
# }

Run the code above in your browser using DataLab