| Title: | Access Brazilian National Treasury Open Data APIs |
|---|---|
| Description: | Provides a unified interface to access open data from the Brazilian National Treasury ('Tesouro Nacional') and related government APIs. Covers six data sources: 'SICONFI' <https://apidatalake.tesouro.gov.br/docs/siconfi/> for fiscal reports ('RREO', 'RGF', 'DCA', 'MSC') and entity information; 'CUSTOS' <https://apidatalake.tesouro.gov.br/docs/custos/> for federal government cost data; 'SADIPEM' <https://apidatalake.tesouro.gov.br/docs/sadipem/> for public debt and credit operations; 'Transferencias Constitucionais' <https://apiapex.tesouro.gov.br/aria/v1/transferencias_constitucionais/docs> for constitutional transfers to states and municipalities; 'SIORG' <https://estruturaorganizacional.dados.gov.br> for federal organizational structure; and 'SIOPE' ('FNDE'/'MEC') for education spending data. Features automatic pagination, in-memory caching, retry logic, and tidy output. |
| Authors: | Andre Leite [aut, cre], Marcos Wasilew [aut], Hugo Vasconcelos [aut], Carlos Amorin [aut], Diogo Bezerra [aut], Tiago Pereira [aut], Fernando Barbalho [aut] |
| Maintainer: | Andre Leite <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.2 |
| Built: | 2026-06-06 07:05:40 UTC |
| Source: | https://github.com/strategicprojects/tesouror |
Retrieves the reference table of report appendices (anexos) grouped by government sphere. This is a support table that describes which appendices are available for each report type (RREO, RGF, DCA, etc.).
get_anexos(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf) get_annexes(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_anexos(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf) get_annexes(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
get_annexes() is an English alias for get_anexos().
A tibble with columns:
Government sphere: "U" (Union), "E" (States), "M" (Municipalities).
Report type (e.g., "RREO", "RGF", "DCA").
Appendix name (e.g., "RREO-Anexo 01").
Other SICONFI:
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: anexos <- get_anexos() ## End(Not run)## Not run: anexos <- get_anexos() ## End(Not run)
Retrieves other (non-personnel) cost data for federal government organizations. All parameters are optional filters.
get_custos_demais( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_other(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_demais( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_other(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
get_costs_other() is an English alias.
A tibble with other cost data.
Other CUSTOS:
get_custos_depreciacao(),
get_custos_pensionistas(),
get_custos_pessoal_ativo(),
get_custos_pessoal_inativo(),
get_custos_transferencias()
## Not run: demais <- get_custos_demais( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)## Not run: demais <- get_custos_demais( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)
Retrieves depreciation cost data for federal government organizations. All parameters are optional filters.
get_custos_depreciacao( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_depreciation(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_depreciacao( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_depreciation(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
get_costs_depreciation() is an English alias.
A tibble with depreciation cost data.
Other CUSTOS:
get_custos_demais(),
get_custos_pensionistas(),
get_custos_pessoal_ativo(),
get_custos_pessoal_inativo(),
get_custos_transferencias()
## Not run: deprec <- get_custos_depreciacao( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)## Not run: deprec <- get_custos_depreciacao( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)
Retrieves cost data for federal government pensioners. All parameters are optional filters.
get_custos_pensionistas( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_pensioners(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_pensionistas( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_pensioners(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
get_costs_pensioners() is an English alias.
A tibble with pensioner cost data.
Other CUSTOS:
get_custos_demais(),
get_custos_depreciacao(),
get_custos_pessoal_ativo(),
get_custos_pessoal_inativo(),
get_custos_transferencias()
## Not run: pensionistas <- get_custos_pensionistas( ano = 2023, mes = 12, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)## Not run: pensionistas <- get_custos_pensionistas( ano = 2023, mes = 12, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)
Retrieves cost data for active federal government staff. All parameters are optional filters.
get_custos_pessoal_ativo( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_active_staff(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_pessoal_ativo( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_active_staff(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
Performance: The CUSTOS API is slow and unfiltered queries return
hundreds of thousands of rows. Always filter by organization level
(organizacao_n1 + organizacao_n2) and/or mes to get manageable
results. Use max_rows for quick tests.
get_costs_active_staff() is an English alias.
A tibble with active staff cost data.
Other CUSTOS:
get_custos_demais(),
get_custos_depreciacao(),
get_custos_pensionistas(),
get_custos_pessoal_inativo(),
get_custos_transferencias()
## Not run: # WARNING: unfiltered queries return hundreds of thousands of rows # and are very slow. Always filter by organization level and/or # natureza_juridica + mes. # Quick test: limit rows ativos <- get_custos_pessoal_ativo(ano = 2023, mes = 6, max_rows = 100) # Filter by ministry (N1) + entity (N2) for manageable results # Use get_siorg_orgaos() to find SIORG codes ativos_inep <- get_custos_pessoal_ativo( ano = 2023, organizacao_n1 = 244, # MEC (auto-padded to "000244") organizacao_n2 = 249 # INEP (auto-padded to "000249") ) ## End(Not run)## Not run: # WARNING: unfiltered queries return hundreds of thousands of rows # and are very slow. Always filter by organization level and/or # natureza_juridica + mes. # Quick test: limit rows ativos <- get_custos_pessoal_ativo(ano = 2023, mes = 6, max_rows = 100) # Filter by ministry (N1) + entity (N2) for manageable results # Use get_siorg_orgaos() to find SIORG codes ativos_inep <- get_custos_pessoal_ativo( ano = 2023, organizacao_n1 = 244, # MEC (auto-padded to "000244") organizacao_n2 = 249 # INEP (auto-padded to "000249") ) ## End(Not run)
Retrieves cost data for retired (inactive) federal government staff. All parameters are optional filters.
get_custos_pessoal_inativo( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_retired_staff(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_pessoal_inativo( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_retired_staff(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
get_costs_retired_staff() is an English alias.
A tibble with retired staff cost data.
Other CUSTOS:
get_custos_demais(),
get_custos_depreciacao(),
get_custos_pensionistas(),
get_custos_pessoal_ativo(),
get_custos_transferencias()
## Not run: # Always filter to avoid slow, large queries inativos <- get_custos_pessoal_inativo( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)## Not run: # Always filter to avoid slow, large queries inativos <- get_custos_pessoal_inativo( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)
Retrieves transfer cost data for federal government organizations. All parameters are optional filters.
get_custos_transferencias( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_transfers(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)get_custos_transferencias( ano = NULL, mes = NULL, natureza_juridica = NULL, organizacao_n1 = NULL, organizacao_n2 = NULL, organizacao_n3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500L, max_rows = Inf ) get_costs_transfers(year = NULL, month = NULL, legal_nature = NULL, org_level1 = NULL, org_level2 = NULL, org_level3 = NULL, use_cache = TRUE, verbose = FALSE, page_size = 500, max_rows = Inf)
ano |
Integer. Year of the record. Optional. |
mes |
Integer. Month of the record (1-12). Optional. |
natureza_juridica |
Integer. Legal nature of the organization:
|
organizacao_n1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
organizacao_n2 |
Character or integer. SIORG code for the
second-level organization. Use |
organizacao_n3 |
Character or integer. SIORG code for the
third-level organization. Use |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Number of rows per API page. Defaults to
|
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
year |
Integer. Year of the record. Optional. Maps to |
month |
Integer. Month of the record (1-12). Optional. Maps to
|
legal_nature |
Integer. Legal nature of the organization:
|
org_level1 |
Character or integer. SIORG code for the top-level
organization (Ministry level). Use |
org_level2 |
Character or integer. SIORG code (second level).
Use |
org_level3 |
Character or integer. SIORG code (third level).
Use |
get_costs_transfers() is an English alias.
A tibble with transfer cost data.
Other CUSTOS:
get_custos_demais(),
get_custos_depreciacao(),
get_custos_pensionistas(),
get_custos_pessoal_ativo(),
get_custos_pessoal_inativo()
## Not run: transf <- get_custos_transferencias( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)## Not run: transf <- get_custos_transferencias( ano = 2023, mes = 6, organizacao_n1 = 244, # MEC organizacao_n2 = 249 # INEP ) ## End(Not run)
Retrieves data from the Annual Accounts Declaration (DCA) or the legacy QDCC for a specific entity and fiscal year.
get_dca( an_exercicio, id_ente, no_anexo = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_annual_accounts(fiscal_year, entity_id, appendix = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_dca( an_exercicio, id_ente, no_anexo = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_annual_accounts(fiscal_year, entity_id, appendix = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
an_exercicio |
Integer. Fiscal year (e.g., |
id_ente |
Integer. IBGE code of the entity. Required. |
no_anexo |
Character. Appendix name filter (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
fiscal_year |
Integer. Fiscal year (e.g., |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
appendix |
Character. Appendix name filter (e.g.,
|
get_annual_accounts() is an English alias for get_dca().
A tibble with DCA/QDCC data including columns such
as exercicio, instituicao, cod_ibge, uf, anexo, rotulo,
coluna, cod_conta, conta, valor, and populacao.
Other SICONFI:
get_anexos(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: dca <- get_dca(an_exercicio = 2022, id_ente = 17) ## End(Not run)## Not run: dca <- get_dca(an_exercicio = 2022, id_ente = 17) ## End(Not run)
Fetches annual accounts (DCA) for every municipality of state_uf, looping
over get_dca() with fault tolerance. See get_rreo_for_state() for the
rationale and behaviour of on_error.
get_dca_for_state( state_uf, an_exercicio, no_anexo = NULL, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_annual_accounts_for_state(state_uf, fiscal_year, appendix = NULL, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_dca_for_state( state_uf, an_exercicio, no_anexo = NULL, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_annual_accounts_for_state(state_uf, fiscal_year, appendix = NULL, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
state_uf |
Character. Two-letter UF code (e.g., |
an_exercicio |
Integer. Fiscal year. Required. |
no_anexo |
Character. Appendix name filter (e.g., |
include_capital |
Logical. Include the state capital? Defaults to |
on_error |
Character. |
use_cache |
Logical. |
verbose |
Logical. |
page_size |
Integer or |
max_rows |
Numeric. |
fiscal_year |
Integer. Fiscal year. Required. Maps to |
appendix |
Character. Appendix name filter. Optional. Maps to |
get_annual_accounts_for_state() is an English-parameter alias.
A tibble with all successful DCA rows. If any
call failed, has an attribute "failed".
Other SICONFI:
get_anexos(),
get_dca(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: dca_pe <- get_dca_for_state(state_uf = "PE", an_exercicio = 2022) ## End(Not run)## Not run: dca_pe <- get_dca_for_state(state_uf = "PE", an_exercicio = 2022) ## End(Not run)
Retrieves the complete list of government entities (entes) registered in the SICONFI system, including states, municipalities, and the Federal District.
get_entes(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf) get_entities(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_entes(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf) get_entities(use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
get_entities() is an English alias for get_entes().
A tibble with columns:
IBGE code of the entity.
Name of the entity.
Whether the municipality is a state capital (1 = yes, 0 = no).
Geographic region ("SU", "NE", "NO", "SE", "CO", "BR").
State abbreviation.
Government sphere: "M", "E", "U", "D".
Year of the population data.
Estimated population.
CNPJ of the entity.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: entes <- get_entes() ## End(Not run)## Not run: entes <- get_entes() ## End(Not run)
Retrieves the extract of report deliveries for a given entity and reference year. Useful for checking which reports have been submitted and their status (approved, rectified, etc.).
get_extrato( id_ente, an_referencia, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_delivery_status(entity_id, year, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_extrato( id_ente, an_referencia, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_delivery_status(entity_id, year, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_ente |
Integer. IBGE code of the entity. Required. |
an_referencia |
Integer. Reference year (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
year |
Integer. Reference year (e.g., |
get_delivery_status() is an English alias for get_extrato().
A tibble with delivery status data including
columns such as exercicio, cod_ibge, instituicao, entregavel,
periodo, periodicidade, status_relatorio, data_status,
forma_envio, and tipo_relatorio.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: extrato <- get_extrato(id_ente = 17, an_referencia = 2022) ## End(Not run)## Not run: extrato <- get_extrato(id_ente = 17, an_referencia = 2022) ## End(Not run)
Retrieves control accounts data (classes 7 and 8) from the Accounting Balances Matrix (MSC).
get_msc_controle( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_control(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_msc_controle( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_control(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_ente |
Integer. IBGE code of the entity. Required. |
an_referencia |
Integer. Reference year. Required. |
me_referencia |
Integer. Reference month (1-12). Required. |
co_tipo_matriz |
Character. Matrix type: |
classe_conta |
Integer. Account class: |
id_tv |
Character. Value type: |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
year |
Integer. Reference year. Required. Maps to
|
month |
Integer. Reference month (1-12). Required. Maps to
|
matrix_type |
Character. Matrix type: |
account_class |
Integer. Account class: |
value_type |
Character. Value type: |
get_msc_control() is an English alias for get_msc_controle().
A tibble with MSC control account data.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: msc_ctrl <- get_msc_controle( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 8, id_tv = "ending_balance" ) ## End(Not run)## Not run: msc_ctrl <- get_msc_controle( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 8, id_tv = "ending_balance" ) ## End(Not run)
Retrieves budgetary accounts data (classes 5 and 6) from the Accounting Balances Matrix (MSC).
get_msc_orcamentaria( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_budget(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_msc_orcamentaria( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_budget(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_ente |
Integer. IBGE code of the entity. Required. |
an_referencia |
Integer. Reference year. Required. |
me_referencia |
Integer. Reference month (1-12). Required. |
co_tipo_matriz |
Character. Matrix type: |
classe_conta |
Integer. Account class: |
id_tv |
Character. Value type: |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
year |
Integer. Reference year. Required. Maps to
|
month |
Integer. Reference month (1-12). Required. Maps to
|
matrix_type |
Character. Matrix type: |
account_class |
Integer. Account class: |
value_type |
Character. Value type: |
get_msc_budget() is an English alias for get_msc_orcamentaria().
A tibble with MSC budgetary account data.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: msc_orc <- get_msc_orcamentaria( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 6, id_tv = "period_change" ) ## End(Not run)## Not run: msc_orc <- get_msc_orcamentaria( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 6, id_tv = "period_change" ) ## End(Not run)
Retrieves equity and asset accounts data (classes 1 to 4) from the Accounting Balances Matrix (MSC).
get_msc_patrimonial( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_equity(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_msc_patrimonial( id_ente, an_referencia, me_referencia, co_tipo_matriz, classe_conta, id_tv, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_msc_equity(entity_id, year, month, matrix_type, account_class, value_type, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_ente |
Integer. IBGE code of the entity. Required. |
an_referencia |
Integer. Reference year. Required. |
me_referencia |
Integer. Reference month (1-12). Required. |
co_tipo_matriz |
Character. Matrix type: |
classe_conta |
Integer. Account class: |
id_tv |
Character. Value type: |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
year |
Integer. Reference year. Required. Maps to
|
month |
Integer. Reference month (1-12). Required. Maps to
|
matrix_type |
Character. Matrix type: |
account_class |
Integer. Account class: |
value_type |
Character. Value type: |
get_msc_equity() is an English alias for get_msc_patrimonial().
A tibble with MSC equity/asset account data.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_rgf(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: msc_pat <- get_msc_patrimonial( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 1, id_tv = "ending_balance" ) ## End(Not run)## Not run: msc_pat <- get_msc_patrimonial( id_ente = 17, an_referencia = 2022, me_referencia = 12, co_tipo_matriz = "MSCC", classe_conta = 1, id_tv = "ending_balance" ) ## End(Not run)
Retrieves the release schedule for credit operations linked to a PVL
request. The id_pleito can be obtained from get_pvl().
get_opc_cronograma_liberacoes( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_release_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_opc_cronograma_liberacoes( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_release_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID from |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of the PVL request. Obtain
from the |
get_credit_release_schedule() is an English alias.
A tibble with release schedule data.
Other SADIPEM:
get_opc_cronograma_pagamentos(),
get_opc_taxa_cambio(),
get_pvl(),
get_pvl_tramitacao(),
get_res_cdp(),
get_res_cronograma_pagamentos()
## Not run: pvl_pe <- get_pvl(uf = "PE") sched <- get_opc_cronograma_liberacoes(id_pleito = pvl_pe$id_pleito[1]) ## End(Not run)## Not run: pvl_pe <- get_pvl(uf = "PE") sched <- get_opc_cronograma_liberacoes(id_pleito = pvl_pe$id_pleito[1]) ## End(Not run)
Retrieves the payment schedule for credit operations linked to a PVL
request. The id_pleito can be obtained from get_pvl().
get_opc_cronograma_pagamentos( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_payment_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_opc_cronograma_pagamentos( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_payment_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID from |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of the PVL request. Obtain
from the |
get_credit_payment_schedule() is an English alias.
A tibble with payment schedule data.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_taxa_cambio(),
get_pvl(),
get_pvl_tramitacao(),
get_res_cdp(),
get_res_cronograma_pagamentos()
## Not run: pvl_pe <- get_pvl(uf = "PE") pgto <- get_opc_cronograma_pagamentos(id_pleito = pvl_pe$id_pleito[1]) ## End(Not run)## Not run: pvl_pe <- get_pvl(uf = "PE") pgto <- get_opc_cronograma_pagamentos(id_pleito = pvl_pe$id_pleito[1]) ## End(Not run)
Retrieves exchange rate data for credit operations linked to a PVL
request. The id_pleito can be obtained from get_pvl().
get_opc_taxa_cambio( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_exchange_rate(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_opc_taxa_cambio( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_credit_exchange_rate(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID from |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of the PVL request. Obtain
from the |
get_credit_exchange_rate() is an English alias.
A tibble with exchange rate data.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_cronograma_pagamentos(),
get_pvl(),
get_pvl_tramitacao(),
get_res_cdp(),
get_res_cronograma_pagamentos()
## Not run: cambio <- get_opc_taxa_cambio(id_pleito = 40353) ## End(Not run)## Not run: cambio <- get_opc_taxa_cambio(id_pleito = 40353) ## End(Not run)
Retrieves data from the Public Debt Verification Letters (PVL) system.
These are requests for approval of credit operations and debt by
subnational entities. Use the resulting id_pleito column to query
detail functions like get_pvl_tramitacao(), get_opc_cronograma_liberacoes(),
etc.
get_pvl( uf = NULL, tipo_interessado = NULL, id_ente = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_requests(state = NULL, entity_type = NULL, entity_id = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_pvl( uf = NULL, tipo_interessado = NULL, id_ente = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_requests(state = NULL, entity_type = NULL, entity_id = NULL, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
uf |
Character. State abbreviation (e.g., |
tipo_interessado |
Character. Type of requesting entity (e.g.,
|
id_ente |
Integer. IBGE code of the requesting entity. Optional. |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
state |
Character. State abbreviation (e.g., |
entity_type |
Character. Type of requesting entity (e.g.,
|
entity_id |
Integer. IBGE code of the requesting entity. Optional.
Maps to |
get_debt_requests() is an English alias.
A tibble with PVL data including id_pleito,
tipo_interessado, interessado, cod_ibge, uf, status,
tipo_operacao, finalidade, credor, valor, and more.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_cronograma_pagamentos(),
get_opc_taxa_cambio(),
get_pvl_tramitacao(),
get_res_cdp(),
get_res_cronograma_pagamentos()
## Not run: # Search all PVLs for Pernambuco pvl_pe <- get_pvl(uf = "PE") # Search by IBGE code (Recife) pvl_recife <- get_pvl(id_ente = 2611606) # Use id_pleito from results for detail queries: id <- pvl_pe$id_pleito[1] pagamentos <- get_opc_cronograma_pagamentos(id_pleito = id) cdp <- get_res_cdp(id_pleito = id) # For PVL processing status, filter approved PVLs first: deferidos <- pvl_pe[pvl_pe$status == "Deferido", ] if (nrow(deferidos) > 0) { status <- get_pvl_tramitacao(id_pleito = deferidos$id_pleito[1]) } ## End(Not run)## Not run: # Search all PVLs for Pernambuco pvl_pe <- get_pvl(uf = "PE") # Search by IBGE code (Recife) pvl_recife <- get_pvl(id_ente = 2611606) # Use id_pleito from results for detail queries: id <- pvl_pe$id_pleito[1] pagamentos <- get_opc_cronograma_pagamentos(id_pleito = id) cdp <- get_res_cdp(id_pleito = id) # For PVL processing status, filter approved PVLs first: deferidos <- pvl_pe[pvl_pe$status == "Deferido", ] if (nrow(deferidos) > 0) { status <- get_pvl_tramitacao(id_pleito = deferidos$id_pleito[1]) } ## End(Not run)
Retrieves processing status for PVL requests that were approved
(deferred) and involve non-credit operations. This endpoint only
returns data for PVLs with status "Deferido". For most PVLs (e.g.,
archived, in progress, or credit operations), this will return an
empty tibble.
get_pvl_tramitacao( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_pvl_status(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_pvl_tramitacao( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_pvl_status(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID of a deferred PVL request
(from the |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of a deferred PVL request.
Obtain from the |
To find PVLs that have data in this endpoint, filter by
status == "Deferido" in the results of get_pvl().
get_pvl_status() is an English alias.
A tibble with PVL processing status data. Returns an empty tibble if the PVL is not an approved non-credit operation.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_cronograma_pagamentos(),
get_opc_taxa_cambio(),
get_pvl(),
get_res_cdp(),
get_res_cronograma_pagamentos()
## Not run: # Step 1: search PVLs and filter for approved ones pvl_pe <- get_pvl(uf = "PE") pvl_deferidos <- pvl_pe[pvl_pe$status == "Deferido", ] # Step 2: pick an id_pleito from the APPROVED requests id <- pvl_deferidos$id_pleito[1] # Step 3: get processing status (only works for deferred PVLs) status <- get_pvl_tramitacao(id_pleito = id) ## End(Not run)## Not run: # Step 1: search PVLs and filter for approved ones pvl_pe <- get_pvl(uf = "PE") pvl_deferidos <- pvl_pe[pvl_pe$status == "Deferido", ] # Step 2: pick an id_pleito from the APPROVED requests id <- pvl_deferidos$id_pleito[1] # Step 3: get processing status (only works for deferred PVLs) status <- get_pvl_tramitacao(id_pleito = id) ## End(Not run)
Retrieves the Debt Capacity Result (Resultado da Capacidade de
Pagamento) linked to a PVL request. The id_pleito can be obtained
from get_pvl().
get_res_cdp( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_capacity(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_res_cdp( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_capacity(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID from |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of the PVL request. Obtain
from the |
get_debt_capacity() is an English alias.
A tibble with CDP result data.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_cronograma_pagamentos(),
get_opc_taxa_cambio(),
get_pvl(),
get_pvl_tramitacao(),
get_res_cronograma_pagamentos()
## Not run: cdp <- get_res_cdp(id_pleito = 40353) ## End(Not run)## Not run: cdp <- get_res_cdp(id_pleito = 40353) ## End(Not run)
Retrieves the payment schedule result linked to a PVL request. The
id_pleito can be obtained from get_pvl().
get_res_cronograma_pagamentos( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_payment_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_res_cronograma_pagamentos( id_pleito, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_debt_payment_schedule(request_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
id_pleito |
Integer. Database ID from |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
request_id |
Integer. Database ID of the PVL request. Obtain
from the |
get_debt_payment_schedule() is an English alias.
A tibble with payment schedule result data.
Other SADIPEM:
get_opc_cronograma_liberacoes(),
get_opc_cronograma_pagamentos(),
get_opc_taxa_cambio(),
get_pvl(),
get_pvl_tramitacao(),
get_res_cdp()
## Not run: pgto_res <- get_res_cronograma_pagamentos(id_pleito = 40353) ## End(Not run)## Not run: pgto_res <- get_res_cronograma_pagamentos(id_pleito = 40353) ## End(Not run)
Retrieves data from the Fiscal Management Report (RGF) for specific filtering criteria. The RGF contains information about personnel expenses, debt, credit operations, and other fiscal indicators.
get_rgf( an_exercicio, in_periodicidade, nr_periodo, co_tipo_demonstrativo, no_anexo, co_esfera, co_poder, id_ente, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_fiscal_report(fiscal_year, periodicity, period, report_type, appendix, sphere, branch, entity_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_rgf( an_exercicio, in_periodicidade, nr_periodo, co_tipo_demonstrativo, no_anexo, co_esfera, co_poder, id_ente, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_fiscal_report(fiscal_year, periodicity, period, report_type, appendix, sphere, branch, entity_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
an_exercicio |
Integer. Fiscal year (e.g., |
in_periodicidade |
Character. Periodicity: |
nr_periodo |
Integer. Period number (1-3 for four-monthly, 1-2 for semi-annual). Required. |
co_tipo_demonstrativo |
Character. Report type: |
no_anexo |
Character. Appendix name (e.g., |
co_esfera |
Character. Government sphere: |
co_poder |
Character. Government branch: |
id_ente |
Integer. IBGE code of the entity. Required. |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
fiscal_year |
Integer. Fiscal year (e.g., |
periodicity |
Character. Periodicity: |
period |
Integer. Period number: |
report_type |
Character. Report type: |
appendix |
Character. Appendix name (e.g., |
sphere |
Character. Government sphere: |
branch |
Character. Government branch: |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
get_fiscal_report() is an English-parameter alias for this function.
A tibble with RGF data.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf_for_state(),
get_rreo(),
get_rreo_for_state()
## Not run: rgf <- get_rgf( an_exercicio = 2022, in_periodicidade = "Q", nr_periodo = 3, co_tipo_demonstrativo = "RGF", no_anexo = "RGF-Anexo 01", co_esfera = "E", co_poder = "E", id_ente = 17 ) ## End(Not run)## Not run: rgf <- get_rgf( an_exercicio = 2022, in_periodicidade = "Q", nr_periodo = 3, co_tipo_demonstrativo = "RGF", no_anexo = "RGF-Anexo 01", co_esfera = "E", co_poder = "E", id_ente = 17 ) ## End(Not run)
Fetches RGF data for every municipality of state_uf, looping over
get_rgf() with fault tolerance. See get_rreo_for_state() for the
rationale and behaviour of on_error.
get_rgf_for_state( state_uf, an_exercicio, in_periodicidade, nr_periodo, co_tipo_demonstrativo, no_anexo, co_poder, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_fiscal_report_for_state(state_uf, fiscal_year, periodicity, period, report_type, appendix, branch, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_rgf_for_state( state_uf, an_exercicio, in_periodicidade, nr_periodo, co_tipo_demonstrativo, no_anexo, co_poder, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_fiscal_report_for_state(state_uf, fiscal_year, periodicity, period, report_type, appendix, branch, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
state_uf |
Character. Two-letter UF code (e.g., |
an_exercicio |
Integer. Fiscal year. Required. |
in_periodicidade |
Character. |
nr_periodo |
Integer. Period number. Required. |
co_tipo_demonstrativo |
Character. |
no_anexo |
Character. Appendix name (e.g., |
co_poder |
Character. Government branch: |
include_capital |
Logical. Include the state capital? Defaults to |
on_error |
Character. |
use_cache |
Logical. |
verbose |
Logical. |
page_size |
Integer or |
max_rows |
Numeric. |
fiscal_year |
Integer. Fiscal year. Required. Maps to |
periodicity |
Character. |
period |
Integer. Period number. Required. Maps to |
report_type |
Character. |
appendix |
Character. Appendix name. Required. Maps to |
branch |
Character. Government branch. Required. Maps to
|
get_fiscal_report_for_state() is an English-parameter alias.
A tibble with all successful RGF rows. If any
call failed, has an attribute "failed".
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rreo(),
get_rreo_for_state()
## Not run: rgf_pe <- get_rgf_for_state( state_uf = "PE", an_exercicio = 2022, in_periodicidade = "Q", nr_periodo = 3, co_tipo_demonstrativo = "RGF", no_anexo = "RGF-Anexo 01", co_poder = "E" ) ## End(Not run)## Not run: rgf_pe <- get_rgf_for_state( state_uf = "PE", an_exercicio = 2022, in_periodicidade = "Q", nr_periodo = 3, co_tipo_demonstrativo = "RGF", no_anexo = "RGF-Anexo 01", co_poder = "E" ) ## End(Not run)
Retrieves data from the Budget Execution Summary Report (RREO) for specific filtering criteria. The RREO is published bimonthly and contains information about revenues, expenses, and other budgetary data.
get_rreo( an_exercicio, nr_periodo, co_tipo_demonstrativo, no_anexo, co_esfera, id_ente, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_budget_report(fiscal_year, period, report_type, appendix, sphere, entity_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_rreo( an_exercicio, nr_periodo, co_tipo_demonstrativo, no_anexo, co_esfera, id_ente, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_budget_report(fiscal_year, period, report_type, appendix, sphere, entity_id, use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
an_exercicio |
Integer. Fiscal year (e.g., |
nr_periodo |
Integer. Bimester number (1-6). Required. |
co_tipo_demonstrativo |
Character. Report type: |
no_anexo |
Character. Appendix name (e.g., |
co_esfera |
Character. Government sphere: |
id_ente |
Integer. IBGE code of the entity. Required. |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum number of rows to return. Defaults
to |
fiscal_year |
Integer. Fiscal year (e.g., |
period |
Integer. Bimester number (1-6). Required.
Maps to |
report_type |
Character. Report type: |
appendix |
Character. Appendix name (e.g., |
sphere |
Character. Government sphere: |
entity_id |
Integer. IBGE code of the entity. Required.
Maps to |
get_budget_report() is an English-parameter alias for this function.
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.
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo_for_state()
## Not run: rreo <- get_rreo( an_exercicio = 2022, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = "RREO-Anexo 01", co_esfera = "E", id_ente = 17 ) ## End(Not run)## Not run: rreo <- get_rreo( an_exercicio = 2022, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = "RREO-Anexo 01", co_esfera = "E", id_ente = 17 ) ## End(Not run)
Fetches RREO data for every municipality of state_uf, looping over
get_rreo() with fault tolerance: if an individual municipality call fails
after all retries, the failure is recorded and the loop continues. Failed
calls are returned in attr(result, "failed").
get_rreo_for_state( state_uf, an_exercicio, nr_periodo, co_tipo_demonstrativo, no_anexo, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_budget_report_for_state(state_uf, fiscal_year, period, report_type, appendix, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)get_rreo_for_state( state_uf, an_exercicio, nr_periodo, co_tipo_demonstrativo, no_anexo, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf ) get_budget_report_for_state(state_uf, fiscal_year, period, report_type, appendix, include_capital = TRUE, on_error = c("warn", "stop", "silent"), use_cache = TRUE, verbose = FALSE, page_size = NULL, max_rows = Inf)
state_uf |
Character. Two-letter UF code (e.g., |
an_exercicio |
Integer. Fiscal year. Required. |
nr_periodo |
Integer. Bimester (1-6). Required. |
co_tipo_demonstrativo |
Character. |
no_anexo |
Character. Appendix name (e.g., |
include_capital |
Logical. Include the state capital? Defaults to |
on_error |
Character. One of |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer or |
max_rows |
Numeric. Maximum rows per municipality call. |
fiscal_year |
Integer. Fiscal year. Required. Maps to
|
period |
Integer. Bimester (1-6). Required. Maps to |
report_type |
Character. |
appendix |
Character. Appendix name. Required. Maps to |
This is the recommended way to assemble a state-wide panel: it handles pagination per municipality, uses the cache, and surfaces partial failures instead of aborting on the first error (see SICONFI behaviour for entities that have not yet homologated a given report).
get_budget_report_for_state() is an English-parameter alias.
A tibble with RREO rows for all successful
municipalities. If any call failed, has an attribute "failed" (tibble
with iteration, id, error).
Other SICONFI:
get_anexos(),
get_dca(),
get_dca_for_state(),
get_entes(),
get_extrato(),
get_msc_controle(),
get_msc_orcamentaria(),
get_msc_patrimonial(),
get_rgf(),
get_rgf_for_state(),
get_rreo()
## Not run: rreo_es <- get_rreo_for_state( state_uf = "ES", an_exercicio = 2021, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = "RREO-Anexo 01" ) attr(rreo_es, "failed") ## End(Not run)## Not run: rreo_es <- get_rreo_for_state( state_uf = "ES", an_exercicio = 2021, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = "RREO-Anexo 01" ) attr(rreo_es, "failed") ## End(Not run)
Retrieves general data from SIOPE including demographics, GDP, revenues, expenses, and declaration metadata for municipalities and states.
get_siope_dados_gerais( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_general_data(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_dados_gerais( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_general_data(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year (e.g., |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation (e.g., |
Performance tip: use the filter parameter to narrow results on
the server before downloading. For example, filtering by municipality
name or IBGE code returns only the rows you need instead of all
municipalities in the state.
get_siope_general_data() is an English alias.
A tibble with 52 columns including tipo,
num_ano, sig_uf, cod_muni, nom_muni, num_popu, revenue and
expense values, PIB data, and declaration metadata.
Other SIOPE:
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: # General data for all municipalities in Pernambuco dados <- get_siope_dados_gerais(ano = 2023, periodo = 6, uf = "PE") # FAST: Filter to a single municipality (server-side) recife <- get_siope_dados_gerais( ano = 2023, periodo = 6, uf = "PE", filter = "NOM_MUNI eq 'Recife'" ) # Filter + select specific columns (use original API names!) resumo <- get_siope_dados_gerais( ano = 2023, periodo = 6, uf = "PE", filter = "COD_MUNI eq 2611606", select = c("NOM_MUNI", "VAL_RECE_REAL", "VAL_DESP_PAGA") ) ## End(Not run)## Not run: # General data for all municipalities in Pernambuco dados <- get_siope_dados_gerais(ano = 2023, periodo = 6, uf = "PE") # FAST: Filter to a single municipality (server-side) recife <- get_siope_dados_gerais( ano = 2023, periodo = 6, uf = "PE", filter = "NOM_MUNI eq 'Recife'" ) # Filter + select specific columns (use original API names!) resumo <- get_siope_dados_gerais( ano = 2023, periodo = 6, uf = "PE", filter = "COD_MUNI eq 2611606", select = c("NOM_MUNI", "VAL_RECE_REAL", "VAL_DESP_PAGA") ) ## End(Not run)
Retrieves education spending data broken down by expense categories for municipalities and states.
get_siope_despesas( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_expenses(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_despesas( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_expenses(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_expenses() is an English alias.
A tibble with 21 columns including expense categories and values.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: desp <- get_siope_despesas(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: desp <- get_siope_despesas(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves education expenses broken down by government function (e.g., basic education, higher education).
get_siope_despesas_funcao( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_expenses_by_function(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_despesas_funcao( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_expenses_by_function(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_expenses_by_function() is an English alias.
A tibble with 12 columns including function codes and expense values.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: desp_func <- get_siope_despesas_funcao(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: desp_func <- get_siope_despesas_funcao(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves education spending indicators such as percentage of revenue applied to education, FUNDEB compliance, etc.
get_siope_indicadores( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_indicators(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_indicadores( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_indicators(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_indicators() is an English alias.
A tibble with 13 columns including indicator codes and values.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: ind <- get_siope_indicadores(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: ind <- get_siope_indicadores(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves supplementary information from SIOPE declarations.
get_siope_info_complementares( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_supplementary(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_info_complementares( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_supplementary(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_supplementary() is an English alias.
A tibble with 10 columns.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_receitas(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: info <- get_siope_info_complementares(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: info <- get_siope_info_complementares(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves education revenue data including tax revenues, transfers, and FUNDEB contributions.
get_siope_receitas( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_revenues(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_receitas( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_revenues(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_revenues() is an English alias.
A tibble with 14 columns including revenue categories and values.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_remuneracao(),
get_siope_responsaveis()
## Not run: rec <- get_siope_receitas(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: rec <- get_siope_receitas(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves compensation data for education professionals. This endpoint
has an additional required parameter: mes / month for the specific
month within the year.
get_siope_remuneracao( ano, periodo, mes, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_compensation(year, period, month, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_remuneracao( ano, periodo, mes, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_compensation(year, period, month, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
mes |
Integer. Month of the fiscal year (1-12). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
month |
Integer. Month (1-12). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_compensation() is an English alias.
A tibble with 19 columns including compensation categories and values for education professionals.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_responsaveis()
## Not run: rem <- get_siope_remuneracao(ano = 2023, periodo = 6, mes = 12, uf = "PE") ## End(Not run)## Not run: rem <- get_siope_remuneracao(ano = 2023, periodo = 6, mes = 12, uf = "PE") ## End(Not run)
Retrieves data about the officials responsible for education spending declarations, including mayors, secretaries, and accountants.
get_siope_responsaveis( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_officials(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)get_siope_responsaveis( ano, periodo, uf, use_cache = TRUE, verbose = FALSE, page_size = 1000L, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL ) get_siope_officials(year, period, state, use_cache = TRUE, verbose = FALSE, page_size = 1000, max_rows = Inf, filter = NULL, orderby = NULL, select = NULL)
ano |
Integer. Year of the data (e.g., |
periodo |
Integer. Bimester period (1-6). Required. |
uf |
Character. State abbreviation (e.g., |
use_cache |
Logical. If |
verbose |
Logical. If |
page_size |
Integer. Rows per page for OData pagination. Defaults
to |
max_rows |
Numeric. Maximum rows to return. Defaults to |
filter |
Character. OData |
orderby |
Character. OData |
select |
Character vector. Column names to return (reduces payload
size). Uses original API column names (e.g.,
|
year |
Integer. Year. Required. Maps to |
period |
Integer. Bimester (1-6). Required. Maps to |
state |
Character. State abbreviation. Required. Maps to |
get_siope_officials() is an English alias.
A tibble with 35 columns including official names, CPFs, roles, and contact information.
Other SIOPE:
get_siope_dados_gerais(),
get_siope_despesas(),
get_siope_despesas_funcao(),
get_siope_indicadores(),
get_siope_info_complementares(),
get_siope_receitas(),
get_siope_remuneracao()
## Not run: resp <- get_siope_responsaveis(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)## Not run: resp <- get_siope_responsaveis(ano = 2023, periodo = 6, uf = "PE") ## End(Not run)
Retrieves the organizational structure tree for a specific SIORG unit, returning all sub-units (departments, secretariats, etc.) as a flat tibble.
get_siorg_estrutura( codigo_unidade, vinculados = NULL, use_cache = TRUE, verbose = FALSE ) get_siorg_structure(unit_code, include_linked = NULL, use_cache = TRUE, verbose = FALSE)get_siorg_estrutura( codigo_unidade, vinculados = NULL, use_cache = TRUE, verbose = FALSE ) get_siorg_structure(unit_code, include_linked = NULL, use_cache = TRUE, verbose = FALSE)
codigo_unidade |
Integer or character. SIORG code of the unit.
Required. Use |
vinculados |
Character. Return linked organs/entities?
|
use_cache |
Logical. If |
verbose |
Logical. If |
unit_code |
Integer or character. SIORG code. Maps to |
include_linked |
Character. |
Use the returned codes as organizacao_n2 / org_level2 and
organizacao_n3 / org_level3 in CUSTOS API functions.
get_siorg_structure() is an English alias.
A tibble with columns including
codigo_unidade, codigo_unidade_pai, nome, sigla,
codigo_tipo_unidade. Use codigo_unidade_pai to navigate
the parent-child hierarchy.
Other SIORG:
get_siorg_orgaos(),
get_siorg_unidade()
## Not run: # Get structure of AGU (code 46) estrutura <- get_siorg_estrutura(codigo_unidade = 46) ## End(Not run)## Not run: # Get structure of AGU (code 46) estrutura <- get_siorg_estrutura(codigo_unidade = 46) ## End(Not run)
Retrieves the list of federal government organizations (organs and
entities) from the SIORG system. Use the returned SIORG codes as
organizacao_n1 / org_level1 in CUSTOS API functions like
get_custos_pessoal_ativo().
get_siorg_orgaos( codigo_poder = NULL, codigo_esfera = NULL, use_cache = TRUE, verbose = FALSE ) get_siorg_organizations(power_code = NULL, sphere_code = NULL, use_cache = TRUE, verbose = FALSE)get_siorg_orgaos( codigo_poder = NULL, codigo_esfera = NULL, use_cache = TRUE, verbose = FALSE ) get_siorg_organizations(power_code = NULL, sphere_code = NULL, use_cache = TRUE, verbose = FALSE)
codigo_poder |
Integer. Power branch code: |
codigo_esfera |
Integer. Government sphere: |
use_cache |
Logical. If |
verbose |
Logical. If |
power_code |
Integer. Power branch: |
sphere_code |
Integer. Sphere: |
get_siorg_organizations() is an English alias.
A tibble with columns including
codigo_unidade (SIORG code — use as organizacao_n1 in CUSTOS),
codigo_unidade_pai (parent code — for navigating hierarchy),
nome, sigla, codigo_tipo_unidade ("orgao" or "entidade"),
codigo_natureza_juridica, codigo_esfera, codigo_poder.
Other SIORG:
get_siorg_estrutura(),
get_siorg_unidade()
## Not run: # List all federal executive branch organizations orgaos <- get_siorg_orgaos(codigo_poder = 1, codigo_esfera = 1) # Find a specific ministry by name mec <- orgaos[grepl("Educação", orgaos$nome), ] mec_code <- mec$codigo_unidade[mec$sigla == "MEC"] # Use that code in CUSTOS queries (auto-padded to "000244") custos <- get_custos_pessoal_ativo( ano = 2023, organizacao_n1 = mec_code ) # Browse children: units whose parent is MEC mec_filhos <- orgaos[orgaos$codigo_unidade_pai == mec_code, ] ## End(Not run)## Not run: # List all federal executive branch organizations orgaos <- get_siorg_orgaos(codigo_poder = 1, codigo_esfera = 1) # Find a specific ministry by name mec <- orgaos[grepl("Educação", orgaos$nome), ] mec_code <- mec$codigo_unidade[mec$sigla == "MEC"] # Use that code in CUSTOS queries (auto-padded to "000244") custos <- get_custos_pessoal_ativo( ano = 2023, organizacao_n1 = mec_code ) # Browse children: units whose parent is MEC mec_filhos <- orgaos[orgaos$codigo_unidade_pai == mec_code, ] ## End(Not run)
Retrieves summary data for a single organizational unit by its SIORG code. Returns a single-row tibble with the unit's details.
get_siorg_unidade(codigo_unidade, use_cache = TRUE, verbose = FALSE) get_siorg_unit(unit_code, use_cache = TRUE, verbose = FALSE)get_siorg_unidade(codigo_unidade, use_cache = TRUE, verbose = FALSE) get_siorg_unit(unit_code, use_cache = TRUE, verbose = FALSE)
codigo_unidade |
Integer or character. SIORG code. Required. |
use_cache |
Logical. If |
verbose |
Logical. If |
unit_code |
Integer or character. SIORG code. Maps to |
get_siorg_unit() is an English alias.
A tibble (single row) with unit details
including codigo_unidade, nome, sigla, codigo_tipo_unidade,
codigo_unidade_pai, codigo_natureza_juridica, and more.
Other SIORG:
get_siorg_estrutura(),
get_siorg_orgaos()
## Not run: # Get details for AGU (code 46) agu <- get_siorg_unidade(codigo_unidade = 46) ## End(Not run)## Not run: # Get details for AGU (code 46) agu <- get_siorg_unidade(codigo_unidade = 46) ## End(Not run)
Retrieves the dictionary of states and their numeric codes. Use these
codes in the p_estado / state_code parameter of other functions.
get_tc_estados(use_cache = TRUE, verbose = FALSE) get_tc_states(use_cache = TRUE, verbose = FALSE)get_tc_estados(use_cache = TRUE, verbose = FALSE) get_tc_states(use_cache = TRUE, verbose = FALSE)
use_cache |
Logical. If |
verbose |
Logical. If |
These are internal Treasury codes, not IBGE codes.
get_tc_states() is an English alias.
A tibble with columns codigo (numeric code)
and nome (name) of each state.
Other Transferencias:
get_tc_municipios(),
get_tc_por_estados(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio(),
get_tc_por_municipio_detalhe(),
get_tc_transferencias()
Other Transferencias dictionaries:
get_tc_municipios(),
get_tc_transferencias()
## Not run: estados <- get_tc_estados() # Use estados$codigo as values for p_estado in other functions ## End(Not run)## Not run: estados <- get_tc_estados() # Use estados$codigo as values for p_estado in other functions ## End(Not run)
Retrieves the dictionary of municipalities and their numeric codes.
Use these codes in the p_municipio / municipality parameter of
other functions.
get_tc_municipios( p_nome = NULL, p_uf = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_municipalities(name = NULL, state_code = NULL, use_cache = TRUE, verbose = FALSE)get_tc_municipios( p_nome = NULL, p_uf = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_municipalities(name = NULL, state_code = NULL, use_cache = TRUE, verbose = FALSE)
p_nome |
Character. Partial municipality name for searching (e.g.,
|
p_uf |
Numeric or character. State code from |
use_cache |
Logical. If |
verbose |
Logical. If |
name |
Character. Partial municipality name for searching (e.g.,
|
state_code |
Numeric or character. State code from
|
These are internal Treasury codes, not IBGE codes.
Filter by state using the numeric code from get_tc_estados().
get_tc_municipalities() is an English alias.
A tibble with municipality data including
codigo, codigo_uf, and nome.
Other Transferencias:
get_tc_estados(),
get_tc_por_estados(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio(),
get_tc_por_municipio_detalhe(),
get_tc_transferencias()
Other Transferencias dictionaries:
get_tc_estados(),
get_tc_transferencias()
## Not run: # Step 1: find the state code (Treasury code, NOT IBGE) estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] # Step 2: list municipalities for that state municipios <- get_tc_municipios(p_uf = pe_code) # Or search by partial name recife <- get_tc_municipios(p_nome = "Recife") ## End(Not run)## Not run: # Step 1: find the state code (Treasury code, NOT IBGE) estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] # Step 2: list municipalities for that state municipios <- get_tc_municipios(p_uf = pe_code) # Or search by partial name recife <- get_tc_municipios(p_nome = "Recife") ## End(Not run)
Retrieves constitutional transfer data aggregated by state.
get_tc_por_estados( p_estado = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, p_sn_detalhar = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_state(state_code = NULL, year = NULL, month = NULL, transfer_type = NULL, detailed = NULL, use_cache = TRUE, verbose = FALSE)get_tc_por_estados( p_estado = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, p_sn_detalhar = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_state(state_code = NULL, year = NULL, month = NULL, transfer_type = NULL, detailed = NULL, use_cache = TRUE, verbose = FALSE)
p_estado |
State code(s) from |
p_ano |
Year(s). Accepts a vector or colon-separated string. Optional. |
p_mes |
Month(s) (1-12). Accepts a vector or colon-separated string. Optional. |
p_transferencia |
Transfer type code(s) from
|
p_sn_detalhar |
Character. Set to any value to include detailed breakdown. Omit for summary. Optional. |
use_cache |
Logical. If |
verbose |
Logical. If |
state_code |
State code(s) from |
year |
Year(s). Accepts a vector or colon-separated string.
Optional. Maps to |
month |
Month(s) (1-12). Accepts a vector or colon-separated
string. Optional. Maps to |
transfer_type |
Transfer type code(s) from
|
detailed |
Character. Set to any value to include a detailed
breakdown. Omit for summary. Optional. Maps to |
All codes are internal Treasury codes (not IBGE). Use the dictionary
functions to look them up: get_tc_estados() for state codes and
get_tc_transferencias() for transfer type codes.
Multi-value parameters accept either a colon-separated string
("1:2:3") or an R vector (c(1, 2, 3)).
get_tc_by_state() is an English alias.
A tibble with transfer data by state.
Other Transferencias:
get_tc_estados(),
get_tc_municipios(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio(),
get_tc_por_municipio_detalhe(),
get_tc_transferencias()
## Not run: # Step 1: look up codes (Treasury codes, NOT IBGE) estados <- get_tc_estados() tipos <- get_tc_transferencias() pe_code <- estados$codigo[estados$nome == "Pernambuco"] # Step 2: query (pass a vector or colon-separated string) tc_pe <- get_tc_por_estados(p_estado = pe_code, p_ano = 2023) tc_multi <- get_tc_por_estados( p_estado = c(1, 2), p_ano = 2023, p_mes = c(1, 2) ) ## End(Not run)## Not run: # Step 1: look up codes (Treasury codes, NOT IBGE) estados <- get_tc_estados() tipos <- get_tc_transferencias() pe_code <- estados$codigo[estados$nome == "Pernambuco"] # Step 2: query (pass a vector or colon-separated string) tc_pe <- get_tc_por_estados(p_estado = pe_code, p_ano = 2023) tc_multi <- get_tc_por_estados( p_estado = c(1, 2), p_ano = 2023, p_mes = c(1, 2) ) ## End(Not run)
Retrieves detailed constitutional transfer data by state, with full breakdown of each transfer.
get_tc_por_estados_detalhe( p_estado = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_state_detail(state_code = NULL, year = NULL, month = NULL, transfer_type = NULL, use_cache = TRUE, verbose = FALSE)get_tc_por_estados_detalhe( p_estado = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_state_detail(state_code = NULL, year = NULL, month = NULL, transfer_type = NULL, use_cache = TRUE, verbose = FALSE)
p_estado |
State code(s) from |
p_ano |
Year(s). Accepts a vector or colon-separated string. Optional. |
p_mes |
Month(s). Accepts a vector or colon-separated string. Optional. |
p_transferencia |
Transfer type code(s) from
|
use_cache |
Logical. If |
verbose |
Logical. If |
state_code |
State code(s) from |
year |
Year(s). Accepts a vector or colon-separated string.
Optional. Maps to |
month |
Month(s) (1-12). Accepts a vector or colon-separated
string. Optional. Maps to |
transfer_type |
Transfer type code(s) from
|
All codes are internal Treasury codes (not IBGE). See
get_tc_estados() and get_tc_transferencias() for dictionaries.
get_tc_by_state_detail() is an English alias.
A tibble with detailed transfer data by state.
Other Transferencias:
get_tc_estados(),
get_tc_municipios(),
get_tc_por_estados(),
get_tc_por_municipio(),
get_tc_por_municipio_detalhe(),
get_tc_transferencias()
## Not run: estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] detalhe <- get_tc_por_estados_detalhe(p_estado = pe_code, p_ano = 2023) ## End(Not run)## Not run: estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] detalhe <- get_tc_por_estados_detalhe(p_estado = pe_code, p_ano = 2023) ## End(Not run)
Retrieves constitutional transfer data for municipalities within states.
get_tc_por_municipio( p_estado = NULL, p_municipio = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, p_sn_detalhar = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_municipality(state_code = NULL, municipality = NULL, year = NULL, month = NULL, transfer_type = NULL, detailed = NULL, use_cache = TRUE, verbose = FALSE)get_tc_por_municipio( p_estado = NULL, p_municipio = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, p_sn_detalhar = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_municipality(state_code = NULL, municipality = NULL, year = NULL, month = NULL, transfer_type = NULL, detailed = NULL, use_cache = TRUE, verbose = FALSE)
p_estado |
State code(s) from |
p_municipio |
Municipality code(s) from |
p_ano |
Year(s). Accepts a vector or colon-separated string. Optional. |
p_mes |
Month(s). Accepts a vector or colon-separated string. Optional. |
p_transferencia |
Transfer type code(s) from
|
p_sn_detalhar |
Character. Set to any value to include detailed breakdown. Optional. |
use_cache |
Logical. If |
verbose |
Logical. If |
state_code |
State code(s) from |
municipality |
Municipality code(s) from |
year |
Year(s). Accepts a vector or colon-separated string.
Optional. Maps to |
month |
Month(s) (1-12). Accepts a vector or colon-separated
string. Optional. Maps to |
transfer_type |
Transfer type code(s) from
|
detailed |
Character. Set to any value to include detail.
Optional. Maps to |
All codes are internal Treasury codes (not IBGE). Use the dictionary
functions to look them up: get_tc_estados() for state codes,
get_tc_municipios() for municipality codes, and
get_tc_transferencias() for transfer type codes.
Multi-value parameters accept either a colon-separated string
("1:2:3") or an R vector (c(1, 2, 3)).
get_tc_by_municipality() is an English alias.
A tibble with transfer data by municipality.
Other Transferencias:
get_tc_estados(),
get_tc_municipios(),
get_tc_por_estados(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio_detalhe(),
get_tc_transferencias()
## Not run: # Step 1: look up codes (Treasury codes, NOT IBGE) estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] municipios <- get_tc_municipios(p_uf = pe_code) recife_code <- municipios$codigo[municipios$nome == "Recife"] # Step 2: query (pass vector or string) tc <- get_tc_por_municipio( p_estado = pe_code, p_municipio = recife_code, p_ano = 2023 ) ## End(Not run)## Not run: # Step 1: look up codes (Treasury codes, NOT IBGE) estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] municipios <- get_tc_municipios(p_uf = pe_code) recife_code <- municipios$codigo[municipios$nome == "Recife"] # Step 2: query (pass vector or string) tc <- get_tc_por_municipio( p_estado = pe_code, p_municipio = recife_code, p_ano = 2023 ) ## End(Not run)
Retrieves detailed constitutional transfer data by municipality.
get_tc_por_municipio_detalhe( p_estado = NULL, p_municipio = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_municipality_detail(state_code = NULL, municipality = NULL, year = NULL, month = NULL, transfer_type = NULL, use_cache = TRUE, verbose = FALSE)get_tc_por_municipio_detalhe( p_estado = NULL, p_municipio = NULL, p_ano = NULL, p_mes = NULL, p_transferencia = NULL, use_cache = TRUE, verbose = FALSE ) get_tc_by_municipality_detail(state_code = NULL, municipality = NULL, year = NULL, month = NULL, transfer_type = NULL, use_cache = TRUE, verbose = FALSE)
p_estado |
State code(s) from |
p_municipio |
Municipality code(s) from |
p_ano |
Year(s). Accepts a vector or colon-separated string. Optional. |
p_mes |
Month(s). Accepts a vector or colon-separated string. Optional. |
p_transferencia |
Transfer type code(s) from
|
use_cache |
Logical. If |
verbose |
Logical. If |
state_code |
State code(s) from |
municipality |
Municipality code(s) from |
year |
Year(s). Accepts a vector or colon-separated string.
Optional. Maps to |
month |
Month(s) (1-12). Accepts a vector or colon-separated
string. Optional. Maps to |
transfer_type |
Transfer type code(s) from
|
All codes are internal Treasury codes (not IBGE). See
get_tc_estados(), get_tc_municipios(), and
get_tc_transferencias() for dictionaries.
get_tc_by_municipality_detail() is an English alias.
A tibble with detailed municipality transfer data.
Other Transferencias:
get_tc_estados(),
get_tc_municipios(),
get_tc_por_estados(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio(),
get_tc_transferencias()
## Not run: estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] det <- get_tc_por_municipio_detalhe(p_estado = pe_code, p_ano = 2023) ## End(Not run)## Not run: estados <- get_tc_estados() pe_code <- estados$codigo[estados$nome == "Pernambuco"] det <- get_tc_por_municipio_detalhe(p_estado = pe_code, p_ano = 2023) ## End(Not run)
Retrieves the dictionary of constitutional transfer types and their
numeric codes. Use these codes in the p_transferencia /
transfer_type parameter of other functions.
get_tc_transferencias(use_cache = TRUE, verbose = FALSE) get_tc_transfer_types(use_cache = TRUE, verbose = FALSE)get_tc_transferencias(use_cache = TRUE, verbose = FALSE) get_tc_transfer_types(use_cache = TRUE, verbose = FALSE)
use_cache |
Logical. If |
verbose |
Logical. If |
These are internal Treasury codes, not IBGE codes.
get_tc_transfer_types() is an English alias.
A tibble with columns codigo (code) and
nome (name) of each transfer type.
Other Transferencias:
get_tc_estados(),
get_tc_municipios(),
get_tc_por_estados(),
get_tc_por_estados_detalhe(),
get_tc_por_municipio(),
get_tc_por_municipio_detalhe()
Other Transferencias dictionaries:
get_tc_estados(),
get_tc_municipios()
## Not run: tipos <- get_tc_transferencias() # Use tipos$codigo as values for p_transferencia in other functions ## End(Not run)## Not run: tipos <- get_tc_transferencias() # Use tipos$codigo as values for p_transferencia in other functions ## End(Not run)
RREO appendix names, account labels, and column suffixes drift across
fiscal years (e.g., RREO-Anexo 04.3 - RGPS for 2019-2022 vs.
RREO-Anexo 04.4 - RGPS for 2023+). The package ships a small reference
table in inst/extdata/rreo_layout.csv that maps (topic, regime, year_range) to the correct appendix and account-matching key.
rreo_layout()rreo_layout()
tidy_rreo() uses this table to assemble layout-stable indicators across
years; you can also use it directly to look up which appendix to fetch
with get_rreo() for a given topic.
A tibble with columns topic, regime,
first_year, last_year, co_esfera, no_anexo, conta_match,
indicador.
Other RREO tidy:
rreo_normalize_columns(),
tidy_rreo()
rreo_layout()rreo_layout()
coluna field of a RREO tibble across yearsSICONFI's RREO column labels drift over years: the same conceptual column
appears as "DESPESAS LIQUIDADAS ATÉ O BIMESTRE / 2019" in 2019,
"DESPESAS LIQUIDADAS ATÉ O BIMESTRE" (no year) in 2021-2022, and
"DESPESAS LIQUIDADAS ATÉ O BIMESTRE / 2023" in 2023+. This helper adds
two columns:
rreo_normalize_columns(data)rreo_normalize_columns(data)
data |
A tibble returned by |
coluna_padrao: the column label with any trailing "/ YYYY" or
"EM YYYY" suffix removed (whitespace squished).
coluna_ano: the year that appeared in the suffix (integer), or NA
when no year was present. Useful for distinguishing the current-year
column from a comparative previous-year column.
The input tibble with coluna_padrao and coluna_ano appended.
Other RREO tidy:
rreo_layout(),
tidy_rreo()
demo <- tibble::tibble( coluna = c( "DESPESAS LIQUIDADAS ATÉ O BIMESTRE / 2023", "DESPESAS LIQUIDADAS ATÉ O BIMESTRE", "INSCRITAS EM RESTOS A PAGAR NÃO PROCESSADOS EM 2023" ) ) rreo_normalize_columns(demo)demo <- tibble::tibble( coluna = c( "DESPESAS LIQUIDADAS ATÉ O BIMESTRE / 2023", "DESPESAS LIQUIDADAS ATÉ O BIMESTRE", "INSCRITAS EM RESTOS A PAGAR NÃO PROCESSADOS EM 2023" ) ) rreo_normalize_columns(demo)
Removes all cached API responses stored during the current R session. This applies to every API covered by the package: SICONFI, CUSTOS, SADIPEM, and Transferencias Constitucionais. All cached responses share the same in-memory store and are cleared together.
tesouror_clear_cache()tesouror_clear_cache()
Invisible NULL.
tesouror_clear_cache()tesouror_clear_cache()
Filters a long RREO tibble (typically produced by get_rreo()) down to the
rows that match a known indicator for topic (and optionally regime),
using the rules in rreo_layout(). Account labels are matched on a
year-stable, accent-folded key (Roman numerals and formula text are
stripped before comparison), so the same call returns a coherent series
across years even when SICONFI relabelled the appendix or account.
tidy_rreo(data, topic, regime = NULL)tidy_rreo(data, topic, regime = NULL)
data |
A tibble returned by |
topic |
Character. Topic name (e.g., |
regime |
Optional character. Filter to a subset of regimes within
|
Currently supported topics:
"previdencia" — federal previdência (RGPS, RPPS civis, FCDF, militares
inativos) for the União sphere. Anexos 04.1 / 04.2 / 04.3 / 04.4 of the
RREO; the layout knows that the RGPS appendix moved from 04.3 (up to 2022) to
04.4 (2023+) and that civis/FCDF moved from 04.1 (up to 2022) to 04.2 (2023+).
Pull requests adding new topics to inst/extdata/rreo_layout.csv are
welcome.
A tibble with the matched rows, plus extra columns:
indicador: stable indicator name (e.g.,
"resultado_previdenciario_rgps").
regime: matched regime.
coluna_padrao, coluna_ano: see rreo_normalize_columns().
Other RREO tidy:
rreo_layout(),
rreo_normalize_columns()
## Not run: library(dplyr) rreo <- purrr::map_dfr(2019:2023, \(yr) { get_rreo(an_exercicio = yr, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = rreo_layout()$no_anexo[ rreo_layout()$topic == "previdencia" & rreo_layout()$regime == "rgps" & yr >= rreo_layout()$first_year & yr <= rreo_layout()$last_year ][1], co_esfera = "U", id_ente = 1) }) tidy_rreo(rreo, topic = "previdencia", regime = "rgps") |> filter(coluna_padrao == "DESPESAS LIQUIDADAS ATÉ O BIMESTRE", is.na(coluna_ano) | coluna_ano == exercicio) |> select(exercicio, indicador, valor) ## End(Not run)## Not run: library(dplyr) rreo <- purrr::map_dfr(2019:2023, \(yr) { get_rreo(an_exercicio = yr, nr_periodo = 6, co_tipo_demonstrativo = "RREO", no_anexo = rreo_layout()$no_anexo[ rreo_layout()$topic == "previdencia" & rreo_layout()$regime == "rgps" & yr >= rreo_layout()$first_year & yr <= rreo_layout()$last_year ][1], co_esfera = "U", id_ente = 1) }) tidy_rreo(rreo, topic = "previdencia", regime = "rgps") |> filter(coluna_padrao == "DESPESAS LIQUIDADAS ATÉ O BIMESTRE", is.na(coluna_ano) | coluna_ano == exercicio) |> select(exercicio, indicador, valor) ## End(Not run)