microdados_arquivos: Discover raw DATASUS microdata files

View source: R/microdata.R

microdados_arquivosR Documentation

Discover raw DATASUS microdata files

Description

Builds the official DATASUS transfer paths and optionally checks whether each file currently exists. SIM and SINASC files are annual; SIH files are monthly.

Usage

microdados_arquivos(
  sistema,
  tipo = NULL,
  ano,
  mes = NULL,
  uf = NULL,
  preliminares = TRUE,
  verificar = TRUE,
  timeout = 120
)

Arguments

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.

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.

Value

A data frame containing official file names, URLs and existence checks. Provenance records the selection and consultation time.

Examples


old_options <- options(
  datasus.timeout = 5,
  datasus.download_timeout = 15,
  datasus.max_tries = 1
)
try({
microdados_arquivos("sim", ano = 2023, uf = "RR")
microdados_arquivos("sih", ano = 2024, mes = 1, uf = "AC")
})
options(old_options)


datasus documentation built on Oct. 7, 2026, 1:07 a.m.