Skip to contents

Retrieves data from the Budget Execution Summary Report (RREO) for a single entity (a state or a municipality, identified by id_ente). The RREO is published bimonthly and contains information about revenues, expenses, and other budgetary data. To sweep every municipality of a state, use get_rreo_municipios().

Usage

get_rreo_ufs(
  an_exercicio,
  nr_periodo,
  co_tipo_demonstrativo,
  no_anexo,
  co_esfera = NULL,
  id_ente,
  use_cache = TRUE,
  verbose = FALSE,
  page_size = NULL,
  max_rows = Inf
)

get_budget_report_ufs(fiscal_year, period, report_type, appendix,
  sphere = NULL, entity_id, use_cache = TRUE, verbose = FALSE,
  page_size = NULL, max_rows = Inf)

Arguments

an_exercicio

Integer. Fiscal year (e.g., 2022). Required.

nr_periodo

Integer. Bimester number (1-6). Required.

co_tipo_demonstrativo

Character. Report type: "RREO" or "RREO Simplificado". Required. Note: "RREO Simplificado" applies only to municipalities with fewer than 50,000 inhabitants that opted for simplified reporting.

no_anexo

Character. Appendix name (e.g., "RREO-Anexo 01"). Required.

co_esfera

Character or NULL. Government sphere: "M" (municipalities), "E" (states), or "U" (union). Optional — defaults to NULL, which omits the co_esfera filter from the request. Some entities (e.g. the Federal District constitutional fund) only return data when the sphere is not supplied, so leave this NULL if a sphere-filtered call comes back empty.

id_ente

Integer. IBGE code of the entity. Required.

use_cache

Logical. If TRUE (default), uses an in-memory cache.

verbose

Logical. If TRUE, prints the full API URL being called. Useful for debugging or testing in a browser. Defaults to getOption("tesouror.verbose", FALSE).

page_size

Integer or NULL. Number of rows per API page. If NULL (default), uses the API server default (5000 for SICONFI/SADIPEM).

max_rows

Numeric. Maximum number of rows to return. Defaults to Inf (all rows). Useful for quick tests with large datasets (e.g., max_rows = 100).

fiscal_year

Integer. Fiscal year (e.g., 2022). Required. Maps to an_exercicio.

period

Integer. Bimester number (1-6). Required. Maps to nr_periodo.

report_type

Character. Report type: "RREO" or "RREO Simplificado". Required. Maps to co_tipo_demonstrativo.

appendix

Character. Appendix name (e.g., "RREO-Anexo 01"). Required. Maps to no_anexo.

sphere

Character or NULL. Government sphere: "M" (municipalities), "E" (states), or "U" (union). Optional — defaults to NULL, which omits the sphere filter. Maps to co_esfera.

entity_id

Integer. IBGE code of the entity. Required. Maps to id_ente.

Value

A tibble with RREO data including columns such as exercicio, demonstrativo, periodo, periodicidade, instituicao, cod_ibge, uf, populacao, anexo, rotulo, coluna, cod_conta, conta, and valor.

Details

get_budget_report_ufs() is an English-parameter alias for this function.

Renamed in 0.3.0 from get_rreo() for clarity. The old name still works but is deprecated.

Examples

if (FALSE) { # \dontrun{
rreo <- get_rreo_ufs(
  an_exercicio = 2022, nr_periodo = 6,
  co_tipo_demonstrativo = "RREO",
  no_anexo = "RREO-Anexo 01",
  co_esfera = "E", id_ente = 17
)
} # }