| microdados_baixar | R Documentation |
Discovers and downloads one or more official DBC files. Downloads use a dedicated cache below option 'datasus.cache_dir'; 'atualizar = TRUE' requests a fresh copy.
microdados_baixar(
sistema,
tipo = NULL,
ano,
mes = NULL,
uf = NULL,
destino = NULL,
cache = TRUE,
atualizar = FALSE,
preliminares = TRUE,
verificar = TRUE,
timeout = 240
)
sistema |
System: '"sim"', '"sinasc"' or '"sih"'. |
tipo |
File type returned by [microdados_catalogo()]. 'NULL' selects the default type for the system. |
ano |
One or more four-digit years. |
mes |
One or more months from 1 to 12. Required for SIH. |
uf |
One or more state abbreviations, two-digit IBGE codes or state names. Required for UF-scoped types. |
destino |
Optional destination directory. 'NULL' uses the package cache, or a session temporary directory when 'cache = FALSE'. |
cache |
Whether to reuse the disk cache. |
atualizar |
Whether to request a fresh copy of already cached files. |
preliminares |
Whether preliminary directories may be considered. |
verificar |
Whether to verify file existence on the DATASUS server. |
timeout |
Network timeout in seconds for file discovery. |
A data frame describing the local files. Use [datasus_proveniencia()] for URLs and checksums.
old_options <- options(
datasus.timeout = 5,
datasus.download_timeout = 15,
datasus.max_tries = 1
)
try({
files <- microdados_baixar("sih", ano = 2024, mes = 1, uf = "AC")
datasus_proveniencia(files)
})
options(old_options)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.