gbcbd_get_series: Imports time series data from BCB-SGS System (Banco Central...

View source: R/gbcbd_get_series.R

gbcbd_get_seriesR Documentation

Imports time series data from BCB-SGS System (Banco Central do Brasil, sistema de series temporais)

Description

Using BCB's oficial API at <https://www.bcb.gov.br/>, this function will download data for a specific set of ids and dates. The main advantage is the use of caching and parallel computing for fast operations. You can search for available series at <http://www.bcb.gov.br/?sgs>

Usage

gbcbd_get_series(
  id,
  first.date = Sys.Date() - 10 * 365,
  last.date = Sys.Date(),
  format.data = "long",
  be.quiet = FALSE,
  use.memoise = TRUE,
  cache.path = gbcbd_get_default_cache_folder(),
  do.parallel = FALSE
)

Arguments

id

Id of time series. The name of the vector sets the name of the series in the output (e.g i.d <- c('SELIC' = 11)). You can search for ids in the official BCB-SGS webpage <http://www.bcb.gov.br/?sgs>

first.date

First date of time series

last.date

Last date of time series

format.data

The format of the datasets - long (default, series incremented by rows) or wide (series incremented by columns)

be.quiet

Logical. Should functions output messages to screen? - FALSE (default) or TRUE

use.memoise

Logical. Sets the use of caching system - TRUE (default) or FALSE

cache.path

Path to save cache files - 'rbcb2_cache' (default)

do.parallel

Logical for parallel data importation - FALSE (default)

Value

A dataframe with requested datasets

Examples


my.id <- c('Taxa de juros - Selic' = 11)
df <- gbcbd_get_series(my.id, cache.path = tempdir())

GetBCBData documentation built on June 8, 2022, 1:07 a.m.