Learn R Programming

meedr (version 0.0.2)

get_annual: Get data on annual market expectations for economic indicators (Focus/BCB)

Description

This function provides the extraction of data and statistics related to the expectations of economic indicators, specifically the annual 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.

Usage

get_annual(
  indicator = NULL,
  detail = 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.

detail

A single string. 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 "YYYY" format, indicating the reference 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: "Balan<U+00E7>a Comercial", "Balan<U+00E7>o de Pagamentos", "Fiscal", "IGP-DI", "IGP-M", "INPC", "IPA-DI", "IPA-M", "IPCA", "IPCA-15", "IPC-FIPE", "Pre<U+00E7>os administrados por contrato e monitorados", "Produ<U+00E7><U+00E3>o industrial", "PIB Agropecu<U+00E1>ria", "PIB Industrial", "PIB Servi<U+00E7>os", "PIB Total", "Meta para taxa over-selic", "Taxa de c<U+00E2>mbio".

Possible values for detail argument: if indicator "Balan<U+00E7>a Comercial" -> "Exporta<U+00E7><U+00F5>es", "Importa<U+00E7><U+00F5>es", "Saldo"; if indicator "Balan<U+00E7>o de Pagamentos" -> "Conta corrente", "Investimento direto no pa<U+00ED>s"; if indicator "Fiscal" -> "Resultado Prim<U+00E1>rio", "Resultado Nominal", "D<U+00ED>vida l<U+00ED>quida do setor p<U+00FA>blico"; if indicator "Meta para taxa over-selic" -> "Fim do ano", "M<U+00E9>dia do ano".

Examples

Run this code
# NOT RUN {
df <- get_annual(
  indicator = "IPCA",
  first_date = Sys.Date() - 30,
  reference_date = format(Sys.Date(), "%Y"),
  use_memoise = FALSE
)
# }

Run the code above in your browser using DataLab