Retrieves the organizational structure tree for a specific SIORG unit, returning all sub-units (departments, secretariats, etc.) as a flat tibble.
Usage
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)Arguments
- codigo_unidade
Integer or character. SIORG code of the unit. Required. Use
get_siorg_orgaos()to find codes.- vinculados
Character. Return linked organs/entities?
"SIM"or"NAO". Optional.- use_cache
Logical. If
TRUE(default), uses an in-memory cache.- verbose
Logical. If
TRUE, prints the full API URL. Defaults togetOption("tesouror.verbose", FALSE).- unit_code
Integer or character. SIORG code. Maps to
codigo_unidade.- include_linked
Character.
"SIM"or"NAO". Maps tovinculados.
Value
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.
Details
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.
See also
Other SIORG:
get_siorg_orgaos(),
get_siorg_unidade()