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)
A tibble with pensioner cost data.
Integer. Year of the record. Optional.
Integer. Month of the record (1-12). Optional.
Integer. Legal nature of the organization:
1 (Public Company), 2 (Public Foundation), 3 (Direct
Administration), 4 (Autarchy), 6 (Mixed Economy Company). Optional.
Character or integer. SIORG code for the top-level
organization (Ministry level). Use get_siorg_orgaos() to look up
codes. You can pass plain codes (e.g., 244) — they are
automatically zero-padded to the 6-digit format the API expects
("000244"). Optional.
Character or integer. SIORG code for the
second-level organization. Use get_siorg_estrutura() to browse
sub-units. Automatically zero-padded. Optional.
Character or integer. SIORG code for the
third-level organization. Use get_siorg_estrutura() to browse
sub-units. Automatically zero-padded. Optional.
Logical. If TRUE (default), uses an in-memory cache.
Logical. If TRUE, prints the full API URL being
called. Useful for debugging or testing in a browser. Defaults to
FALSE.
Integer. Number of rows per API page. Defaults to
500. The CUSTOS backend is slow on broad queries: smaller pages
are more robust against HTTP 504 timeouts at the cost of a few
extra round-trips. The server default of 250 is conservative;
1000+ may time out. If the package returns
attr(result, "partial") = TRUE, lower this further or add a
mes filter.
Numeric. Maximum number of rows to return. Defaults
to Inf (all rows). Useful for quick tests with large datasets
(e.g., max_rows = 100).
Integer. Year of the record. Optional. Maps to ano.
Integer. Month of the record (1-12). Optional. Maps to
mes.
Integer. Legal nature of the organization:
1 (Public Company), 2 (Public Foundation), 3 (Direct
Administration), 4 (Autarchy), 6 (Mixed Economy Company).
Optional. Maps to natureza_juridica.
Character or integer. SIORG code for the top-level
organization (Ministry level). Use get_siorg_organizations() to
look up codes. Plain codes (e.g., 244) are auto-padded to
"000244". Optional. Maps to organizacao_n1.
Character or integer. SIORG code (second level).
Use get_siorg_structure() to browse sub-units. Auto-padded.
Optional. Maps to organizacao_n2.
Character or integer. SIORG code (third level).
Use get_siorg_structure() to browse sub-units. Auto-padded.
Optional. Maps to organizacao_n3.
get_costs_pensioners() is an English alias.
Other CUSTOS:
get_custos_demais(),
get_custos_depreciacao(),
get_custos_pessoal_ativo(),
get_custos_pessoal_inativo(),
get_custos_transferencias()
if (FALSE) {
pensionistas <- get_custos_pensionistas(
ano = 2023, mes = 12,
organizacao_n1 = 244, # MEC
organizacao_n2 = 249 # INEP
)
}
Run the code above in your browser using DataLab