Learn R Programming

tesouror (version 0.2.2)

get_siorg_estrutura: Get organizational structure from SIORG

Description

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)

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.

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 to getOption("tesouror.verbose", FALSE).

unit_code

Integer or character. SIORG code. Maps to codigo_unidade.

include_linked

Character. "SIM" or "NAO". Maps to vinculados.

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()

Examples

Run this code
if (FALSE) {
# Get structure of AGU (code 46)
estrutura <- get_siorg_estrutura(codigo_unidade = 46)
}

Run the code above in your browser using DataLab