This function provides the extraction of data and statistics related to expectations of economic indicators, specifically the quarterly market expectations, made available by the Central Bank of Brazil's Expectations System through the Olinda API. The data comes from several financial institutions: banks, funds, research houses, etc. Important: arguments are case sensitive.

get_quarterly(
  indicator = NULL,
  first_date = Sys.Date() - 2 * 365,
  last_date = Sys.Date(),
  reference_date = NULL,
  be_quiet = FALSE,
  use_memoise = TRUE,
  do_parallel = FALSE
)

Arguments

indicator

A single string or a character vector with economic indicators names, see details for possible values. Defaults to NULL.

first_date

A single string or Date in "YYYY-mm-dd" format. Default for 2 years prior to the current date.

last_date

A single string or Date in "YYYY-mm-dd" format. Default is the current date.

reference_date

A single string in "q/YYYY" format, indicating the reference quarter and year for which the statistic is expected. Defaults to NULL.

be_quiet

Logical. Should messages or warnings not be displayed? Defaults to FALSE.

use_memoise

Logical. Sets the use of caching system, creating a folder named "cache_bcb" by default. Default to TRUE.

do_parallel

Logical. For using parallel data importation. Defaults to FALSE.

Value

A tibble with data from BCB-Olinda Data Services.

Details

For periods for which there are no statistics, they will be omitted from the query.

Possible values for indicator argument: 'IPCA', 'IPCA Administrados', 'IPCA Alimentação no domicílio', 'IPCA Bens industrializados', 'IPCA Livres', 'IPCA Serviços', 'Câmbio', 'PIB Agropecuária', 'PIB Indústria', 'PIB Serviços', 'PIB Total', 'Taxa de desocupação'.

Author

Fernando da Silva <fernando@fortietwo.com>

Examples

df <- get_quarterly(
  indicator = "PIB Total",
  first_date = Sys.Date() - 30,
  reference_date = paste0(substr(quarters(Sys.Date()), 2, 2), "/",
                          format(Sys.Date(), format = "%Y")
                          ),
  use_memoise = FALSE
)
#> 
#> Fetching [PIB Total] data from BCB-Olinda... 
#> 
#> Found 36 observations!