| caged_adjustments_load | R Documentation |
Baixa, parseia e grava os arquivos do CAGED Ajustes no banco DuckDB local.
caged_adjustments_load(
years,
months = seq_len(12L),
db_path,
destdir = NULL,
force_download = FALSE,
overwrite_competencies = FALSE,
timeout = 300
)
years |
integer vector. Desired years. Maximum: 2019. |
months |
integer vector. Desired months (1–12). Default: |
db_path |
character. Path to the file |
destdir |
character or NULL. Cache directory for |
force_download |
logical. If TRUE, re-downloads even if already cached. Default: FALSE. |
overwrite_competencies |
logical. If TRUE, overwrites competencies already in the database. Default: FALSE. |
timeout |
integer. Timeout in seconds. Default: 300. |
O CAGED Ajustes contém correções retroativas de vínculos do CAGED antigo
(até 2019). Cada arquivo CAGEDEST_AJUSTES_{MM}{AAAA}.7z registra
movimentações ajustadas após a declaração original — essencial para
reconstrução de séries históricas mais precisas.
Os dados são gravados na tabela caged_ajustes do banco DuckDB, com o mesmo
schema do caged_antigo.
invisível: tibble com estatísticas do banco após a carga.
caged_load() para Novo CAGED (2020+) e CAGED antigo (até 2019).
caged_hf_files() com type = "ajustes" para listar disponibilidade.
## Not run:
# List available adjustment competencies first
avail <- caged_hf_files(type = "ajustes", n = 3, verbose = FALSE)
if (nrow(avail) > 0) {
db <- file.path(tempdir(), "caged_ajustes.duckdb")
# Download and load adjustments
caged_adjustments_load(
years = avail$ano[1],
months = avail$mes[1],
db_path = db
)
con <- caged_connect(db)
# List tables and records
dplyr::tbl(con, "caged_ajustes") |>
dplyr::group_by(competencia) |>
dplyr::count() |>
dplyr::collect()
DBI::dbDisconnect(con, shutdown = TRUE)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.