| Title: | An Interface to Brazilian Public Health Data |
|---|---|
| Description: | Retrieves public health data from the Department of Informatics ('DATASUS') of the Brazilian Unified Health System ('Sistema Unico de Saude', 'SUS') through its online tabulation service and open-data catalog. It covers the Mortality Information System ('SIM'), Live Birth Information System ('SINASC'), Hospital Information System of the Unified Health System ('SIH/SUS'), Outpatient Information System of the Unified Health System ('SIA/SUS'), National Register of Health Establishments ('CNES'), Notifiable Diseases Information System ('SINAN'), National Immunization Program ('PNI'), Cancer Information System ('SISCAN'), and Food and Nutrition Surveillance System ('SISVAN'). Contemporary sources from the 'OpenDataSUS' portal include Events Supposedly Attributable to Vaccination or Immunization ('ESAVI'), influenza-like illness notifications from 'e-SUS Notifica', individual vaccination doses, coronavirus disease 2019 (COVID-19) hospital occupancy, and record-level mortality, live-birth and hospital-admission microdata. Curated schemas, selective columns, multipart downloads and chunk processing support memory-efficient analysis of large files. The package also provides grouped epidemiological indicators, confidence intervals, population-denominator joins, epidemiological calendars, moving averages and direct age standardization. An offline reference from the Brazilian Institute of Geography and Statistics (IBGE) supports territorial codes, joins and completion of geographic time series. |
| Authors: | Renato Prado Siqueira [aut, cre] |
| Maintainer: | Renato Prado Siqueira <[email protected]> |
| License: | GPL-3 |
| Version: | 0.16.1 |
| Built: | 2026-10-07 09:20:14 UTC |
| Source: | https://github.com/rpradosiqueira/datasus |
'datasus' provides a stable interface to aggregated TABNET queries, OpenDataSUS resources, record-level DATASUS files, territorial references and epidemiological analysis helpers. Discovery functions can be used before any download, and local catalogs and transformations remain usable without network access.
Start with [datasus_catalogo()] for supported TABNET datasets, [opendatasus_catalogo()] for contemporary portal datasets, or [microdados_catalogo()] for raw DBC/DBF file families. Plan requests with [datasus_opcoes()], [opendatasus_recursos()], [opendatasus_arquivos()] or [microdados_arquivos()] before querying or downloading data.
Use [opendatasus_baixar()] and [microdados_baixar()] when another engine will read the files, or [opendatasus_ler()] and [microdados_ler()] for in-memory workflows. System-specific functions such as [sim()], [sinasc()], [sih_producao()] and [cnes()] provide concise entry points for common data products.
Downloaded objects carry source, consultation time, local path and checksum metadata retrievable with [datasus_proveniencia()]. Use [datasus_dicionario()] and [datasus_validar_esquema()] to inspect curated fields and detect missing or type-incompatible analysis fields. Cache paths use [tools::R_user_dir()] by default and can be changed with option 'datasus.cache_dir'.
Historical 'sim_*()' and 'sinasc_nv_*()' functions remain available for existing scripts. Their public signatures are preserved; new workflows should prefer [sim()] and [sinasc()]. Network integrations are tested only by explicit or scheduled smoke tests, while regular package tests use local fixtures and mocks.
Maintainer: Renato Prado Siqueira [email protected]
Authors:
Renato Prado Siqueira [email protected]
Useful links:
Report bugs at https://github.com/rpradosiqueira/datasus/issues
Validates a territorial code column and appends the corresponding current IBGE names and hierarchy. Six-digit DATASUS municipality codes are converted to seven-digit IBGE codes. The function does not redistribute historical observations across boundary changes.
adicionar_territorio( dados, codigo, nivel = c("municipio", "uf", "regiao"), desconhecido = c("erro", "na"), sobrescrever = FALSE )adicionar_territorio( dados, codigo, nivel = c("municipio", "uf", "regiao"), desconhecido = c("erro", "na"), sobrescrever = FALSE )
dados |
A data frame. |
codigo |
Name of the territorial code column. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
desconhecido |
How to handle unknown values: '"erro"', '"na"' or '"manter"'. |
sobrescrever |
Whether existing columns with catalog names may be replaced. |
'dados' with territorial columns appended.
dados <- data.frame(codmun = c("500270", "500370"), casos = c(10, 5)) adicionar_territorio(dados, "codmun")dados <- data.frame(codmun = c("500270", "500370"), casos = c(10, 5)) adicionar_territorio(dados, "codmun")
Aggregates numerator and denominator counts before calculating rates, proportions, ratios or case fatality. Rates use exact Poisson confidence intervals; proportions and case fatality use exact binomial intervals.
calcular_indicador( dados, numerador, denominador, grupo = NULL, tipo = c("taxa", "proporcao", "razao", "letalidade"), multiplicador = NULL, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )calcular_indicador( dados, numerador, denominador, grupo = NULL, tipo = c("taxa", "proporcao", "razao", "letalidade"), multiplicador = NULL, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )
dados |
A non-empty data frame. |
numerador |
Name of the non-negative numerator column. |
denominador |
Name of the non-negative denominator column. |
grupo |
Optional character vector naming grouping columns. |
tipo |
Indicator type: '"taxa"', '"proporcao"', '"razao"' or '"letalidade"'. |
multiplicador |
Positive scale factor. When omitted, defaults to 100,000 for rates, 100 for proportions and case fatality, and 1 for ratios. |
confianca |
Optional confidence level. Exact intervals are available for rates, proportions and case fatality, but not for ratios. |
na_rm |
Whether rows with a missing numerator or denominator should be removed pairwise within each group. A group containing no complete row remains missing. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame containing the grouping columns, aggregated 'numerador', aggregated 'denominador', 'indicador', and optional confidence limits.
dados <- data.frame( ano = c(2024, 2024, 2025), casos = c(10, 20, 15), populacao = c(50000, 50000, 100000) ) calcular_indicador( dados, "casos", "populacao", grupo = "ano", tipo = "taxa" )dados <- data.frame( ano = c(2024, 2024, 2025), casos = c(10, 20, 15), populacao = c(50000, 50000, 100000) ) calcular_indicador( dados, "casos", "populacao", grupo = "ano", tipo = "taxa" )
Calculates 'eventos / populacao * multiplicador' with explicit validation of counts and denominators. Missing values propagate to the result.
calcular_taxa( eventos, populacao, multiplicador = 1e+05, zero_denominador = c("na", "erro") )calcular_taxa( eventos, populacao, multiplicador = 1e+05, zero_denominador = c("na", "erro") )
eventos |
Non-negative event counts. |
populacao |
Non-negative population or person-time denominators. |
multiplicador |
Scale of the rate, default 100,000. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A numeric vector with the calculated rates.
calcular_taxa(c(10, 25), c(10000, 20000)) calcular_taxa(25, 20000, multiplicador = 1000)calcular_taxa(c(10, 25), c(10000, 20000)) calcular_taxa(25, 20000, multiplicador = 1000)
Generate a Brazilian epidemiological calendar
calendario_epidemiologico(ano)calendario_epidemiologico(ano)
ano |
One epidemiological year. |
A data frame with the 52 or 53 epidemiological weeks in the year.
calendario_epidemiologico(2026)calendario_epidemiologico(2026)
Supports establishments, physical resources, human resources and health teams. Use 'datasus_catalogo("cnes")' to list the available datasets.
cnes( conjunto = "estabelecimentos", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )cnes( conjunto = "estabelecimentos", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ cnes(uf = "MS") cnes( conjunto = "leitos_internacao", uf = "MS", periodo = "last" ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ cnes(uf = "MS") cnes( conjunto = "leitos_internacao", uf = "MS", periodo = "last" ) }) options(old_options)
Adds absent territory-period rows while protecting existing observations. By default the territorial universe is the set observed in 'dados'. Supply 'uf' to complete all current territories in one or more states, or 'territorios' for an explicit universe. If 'periodos' is omitted, the distinct periods observed in the data are used.
completar_territorios( dados, codigo, periodo = NULL, grupo = NULL, nivel = c("municipio", "uf", "regiao"), territorios = NULL, uf = NULL, periodos = NULL, preencher = list(), adicionar = TRUE )completar_territorios( dados, codigo, periodo = NULL, grupo = NULL, nivel = c("municipio", "uf", "regiao"), territorios = NULL, uf = NULL, periodos = NULL, preencher = list(), adicionar = TRUE )
dados |
A data frame. |
codigo |
Name of the territorial code column. |
periodo |
Optional name of the period column. |
grupo |
Optional names of grouping columns whose observed combinations must be completed separately. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
territorios |
Optional vector defining the territorial universe. |
uf |
Optional state selector used to define the current territorial universe. For municipality data it includes every current municipality in the selected states. |
periodos |
Optional vector defining the period universe. |
preencher |
Named list of scalar values used only for rows created by the function, for example 'list(casos = 0)'. |
adicionar |
Whether to append current territorial attributes with [adicionar_territorio()]. |
A data frame ordered by groups, territory and period.
dados <- data.frame( codmun = c("500270", "500270", "500370"), ano = c(2023, 2025, 2023), casos = c(10, 12, 5) ) completar_territorios( dados, "codmun", "ano", periodos = 2023:2025, preencher = list(casos = 0) )dados <- data.frame( codmun = c("500270", "500270", "500370"), ano = c(2023, 2025, 2023), casos = c(10, 12, 5) ) completar_territorios( dados, "codmun", "ano", periodos = 2023:2025, preencher = list(casos = 0) )
Returns the local catalog used by the health-services query functions. This function does not access the network.
datasus_catalogo(sistema = NULL)datasus_catalogo(sistema = NULL)
sistema |
Optional system name: '"sih"', '"sia"', '"cnes"', '"populacao"', '"sinan"', '"pni"', '"siscan"', '"sisvan"' or '"financiamento"', '"sim"' or '"sinasc"'. |
A data frame with the system, dataset name, category, description and geographic form scope.
datasus_catalogo() datasus_catalogo("cnes")datasus_catalogo() datasus_catalogo("cnes")
Returns the fields currently standardized by [datasus_padronizar()]. Contemporary schemas cover the variables documented in the official ESAVI, e-SUS Notifica, PNI and hospital-occupancy dictionaries. Fields added by a source after the packaged dictionary was released remain untouched and can be detected with [datasus_validar_esquema()].
datasus_dicionario(sistema, tipo = NULL)datasus_dicionario(sistema, tipo = NULL)
sistema |
System: '"sim"', '"sinasc"', '"sih"', '"esavi"', '"sindrome_gripal"', '"pni_doses"' or '"ocupacao_hospitalar"'. |
tipo |
Optional raw file type. 'NULL' selects the default type. |
A data frame with original field, standardized field, description, target class and date format.
datasus_dicionario("sim") datasus_dicionario("sih", "RD")datasus_dicionario("sim") datasus_dicionario("sih", "RD")
Reads the current TABNET form and returns its row, column, measure, period and filter choices. Filter names in the returned 'filtros' list are the names accepted by the query functions.
datasus_opcoes(sistema, conjunto = NULL, uf = NULL, abrangencia = NULL)datasus_opcoes(sistema, conjunto = NULL, uf = NULL, abrangencia = NULL)
sistema |
System name accepted by [datasus_catalogo()]. |
conjunto |
Dataset name listed by [datasus_catalogo()]. When omitted, uses the default dataset for the system. |
uf |
State abbreviation, two-digit IBGE code or state name. When 'NULL', uses the Brazil form. |
abrangencia |
Optional geographic detail for SIM and SINASC: '"municipio"' for the nationwide municipal form or '"uf"' for the region/state form. Other systems retain their existing behavior. |
An object of class 'datasus_opcoes'. Its components are data frames named 'linha', 'coluna', 'conteudo' and 'periodo', plus a named list 'filtros'.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ op <- datasus_opcoes("sih", uf = "MS") op$conteudo op$filtros$carater_atendimento }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ op <- datasus_opcoes("sih", uf = "MS") op$conteudo op$filtros$carater_atendimento }) options(old_options)
Renames curated fields and converts documented dates, identifiers, numeric measures and logical indicators. Unrecognized columns and coded category values are preserved exactly as published.
datasus_padronizar(dados, sistema, tipo = NULL)datasus_padronizar(dados, sistema, tipo = NULL)
dados |
A data frame containing raw DATASUS records. |
sistema |
System accepted by [datasus_dicionario()]. |
tipo |
Optional raw file type. 'NULL' selects the default type. |
The input data frame with curated fields renamed and typed. Provenance is preserved and the applied dictionary is attached as attribute '"datasus_dicionario"'.
example <- data.frame( MUNIC_RES = "120040", DT_INTER = "20240110", DIAG_PRINC = "J18" ) datasus_padronizar(example, "sih")example <- data.frame( MUNIC_RES = "120040", DT_INTER = "20240110", DIAG_PRINC = "J18" ) datasus_padronizar(example, "sih")
Retrieve DATASUS provenance metadata
datasus_proveniencia(x)datasus_proveniencia(x)
x |
An object returned by [opendatasus_catalogo()], [opendatasus_recursos()], [opendatasus_baixar()] or [opendatasus_ler()]. |
A named list, or 'NULL' when no provenance metadata is attached.
Returns the package's offline territorial reference. The municipality table is generated from the official IBGE Localities API and contains current municipality, state, macroregion, immediate/intermediate region and legacy micro/mesoregion codes and names.
datasus_territorios(nivel = c("municipio", "uf", "regiao"), uf = NULL)datasus_territorios(nivel = c("municipio", "uf", "regiao"), uf = NULL)
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
uf |
Optional state selector. It accepts a two-digit IBGE code, state abbreviation or full state name. It is available for municipality and state results. |
A data frame. Source and extraction metadata are available through [datasus_proveniencia()].
datasus_territorios("regiao") datasus_territorios("uf") head(datasus_territorios("municipio", uf = "MS"))datasus_territorios("regiao") datasus_territorios("uf") head(datasus_territorios("municipio", uf = "MS"))
Compares the columns of a raw or standardized data frame with fields in [datasus_dicionario()]. This detects missing fields and incompatible target classes without treating newly introduced source columns as errors.
datasus_validar_esquema( dados, sistema, tipo = NULL, campos = NULL, estrito = FALSE )datasus_validar_esquema( dados, sistema, tipo = NULL, campos = NULL, estrito = FALSE )
dados |
A data frame containing raw or standardized records. |
sistema |
System accepted by [datasus_dicionario()]. |
tipo |
Optional raw file type for SIM, SINASC or SIH. |
campos |
Optional source or standardized field names to require. 'NULL' checks every curated field for the selected system. |
estrito |
Whether missing or incompatibly typed standardized fields should raise an error. |
A data frame with source and standardized field names, presence, observed column and class, expected class and status. Attribute '"campos_extras"' lists columns outside the curated dictionary.
dados <- data.frame( dt_vacina = "2025-01-10", co_municipio_paciente = "5002704" ) datasus_validar_esquema(dados, "pni_doses")dados <- data.frame( dt_vacina = "2025-01-10", co_municipio_paciente = "5002704" ) datasus_validar_esquema(dados, "pni_doses")
Downloads anonymous individual records from the e-SUS Notifica ESAVI module. The source contains notifications since January 2021 and is continuously updated. An event following immunization does not by itself establish a causal association with a vaccine.
esavi( formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )esavi( formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )
formato |
File format, '"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local OpenDataSUS cache. |
atualizar |
Whether to force a fresh metadata query and download. |
n_max |
Maximum number of rows to read. |
colunas |
Optional character vector selecting columns during CSV parsing. |
normalizar |
Whether to apply the curated contemporary schema with [datasus_padronizar()]. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource with provenance metadata.
OpenDataSUS. ESAVI - Dados sobre Eventos Supostamente Atribuíveis a Vacinação. https://dadosabertos.saude.gov.br/dataset/esavi
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ eventos <- esavi(n_max = 1000) datasus_proveniencia(eventos) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ eventos <- esavi(n_max = 1000) datasus_proveniencia(eventos) }) options(old_options)
Downloads anonymous mild and moderate influenza-like illness notifications published by annual dataset and state. These records are distinct from hospitalized severe acute respiratory syndrome records returned by [sivep_gripe()].
esus_sindrome_gripal( uf, ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )esus_sindrome_gripal( uf, ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )
uf |
One Brazilian state abbreviation, IBGE code or state name. |
ano |
Dataset year from 2020 onwards, or '"last"' for the latest annual dataset currently published. |
formato |
File format. The annual state resources are published as '"CSV"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local OpenDataSUS cache. |
atualizar |
Whether to force a fresh metadata query and download. |
n_max |
Maximum number of rows to read. |
colunas |
Optional character vector selecting columns during CSV parsing. |
normalizar |
Whether to apply the curated contemporary schema with [datasus_padronizar()]. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource with provenance metadata.
OpenDataSUS. Notificações de Síndrome Gripal. https://dadosabertos.saude.gov.br/dataset?query=sindrome+gripal
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ casos <- esus_sindrome_gripal(uf = "MS", ano = 2024, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ casos <- esus_sindrome_gripal(uf = "MS", ano = 2024, n_max = 1000) }) options(old_options)
Extracts the first territorial code embedded in labels such as '"500270 Campo Grande"' and then validates and converts it with [normalizar_codigo_ibge()].
extrair_codigo_ibge( x, nivel = c("municipio", "uf", "regiao"), formato = NULL, desconhecido = c("erro", "na", "manter") )extrair_codigo_ibge( x, nivel = c("municipio", "uf", "regiao"), formato = NULL, desconhecido = c("erro", "na", "manter") )
x |
Character vector containing codes or labeled values. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
formato |
Output format. Municipalities support '"ibge"' (seven digits) and '"datasus"' (six digits). States and regions additionally support '"sigla"' and '"nome"'. |
desconhecido |
How to handle unknown values: '"erro"', '"na"' or '"manter"'. |
A normalized character vector.
extrair_codigo_ibge(c("500270 Campo Grande", "500370 Dourados"))extrair_codigo_ibge(c("500270 Campo Grande", "500370 Dourados"))
Provides the three financial tables linked by the DATASUS TABNET catalog: federal resources, approved production values by provider, and payment authorization guides. Availability periods vary and may be historical.
financiamento_sus( conjunto = "recursos_federais", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )financiamento_sus( conjunto = "recursos_federais", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ financiamento_sus(uf = "MS") financiamento_sus(conjunto = "producao_prestador", uf = "MS") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ financiamento_sus(uf = "MS") financiamento_sus(conjunto = "producao_prestador", uf = "MS") }) options(old_options)
Uses chi-squared quantiles for exact Poisson count limits and divides them by the supplied denominator. Event counts must be whole numbers.
intervalo_taxa( eventos, populacao, multiplicador = 1e+05, confianca = 0.95, zero_denominador = c("na", "erro") )intervalo_taxa( eventos, populacao, multiplicador = 1e+05, confianca = 0.95, zero_denominador = c("na", "erro") )
eventos |
Non-negative event counts. |
populacao |
Non-negative population or person-time denominators. |
multiplicador |
Scale of the rate, default 100,000. |
confianca |
Confidence level between 0 and 1. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame with event counts, denominators, rates and lower and upper confidence limits.
intervalo_taxa(c(0, 10), c(10000, 10000))intervalo_taxa(c(0, 10), c(10000, 10000))
Performs a many-to-one join from observations to a population table, preserving observation order and rejecting ambiguous denominator keys. This is designed to connect outputs from [populacao_residente()] to event tables before calculating population-based indicators.
juntar_populacao( dados, populacao, por, coluna_populacao = "populacao", nome = "populacao", ausente = c("erro", "na"), sobrescrever = FALSE )juntar_populacao( dados, populacao, por, coluna_populacao = "populacao", nome = "populacao", ausente = c("erro", "na"), sobrescrever = FALSE )
dados |
Observation data frame. |
populacao |
Population data frame. |
por |
Character vector of join columns. An unnamed vector uses the same names in both tables. In a named vector, names refer to columns in 'dados' and values to columns in 'populacao'. |
coluna_populacao |
Name of the numeric denominator column in 'populacao'. |
nome |
Name assigned to the joined denominator column. |
ausente |
How to handle observations without a denominator: '"erro"' stops and '"na"' keeps them with a missing value. |
sobrescrever |
Whether an existing 'nome' column in 'dados' may be replaced. |
'dados' with one validated population denominator column appended.
eventos <- data.frame(codigo = c("A", "B"), ano = 2024, casos = c(2, 4)) denominadores <- data.frame( municipio = c("A", "B"), ano = 2024, habitantes = c(1000, 2000) ) juntar_populacao( eventos, denominadores, por = c(codigo = "municipio", ano = "ano"), coluna_populacao = "habitantes" )eventos <- data.frame(codigo = c("A", "B"), ano = 2024, casos = c(2, 4)) denominadores <- data.frame( municipio = c("A", "B"), ano = 2024, habitantes = c(1000, 2000) ) juntar_populacao( eventos, denominadores, por = c(codigo = "municipio", ano = "ano"), coluna_populacao = "habitantes" )
Calculate grouped case fatality
letalidade( dados, obitos, casos, grupo = NULL, multiplicador = 100, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )letalidade( dados, obitos, casos, grupo = NULL, multiplicador = 100, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )
dados |
A non-empty data frame. |
obitos |
Name of the deaths among cases column. |
casos |
Name of the cases column. |
grupo |
Optional character vector naming grouping columns. |
multiplicador |
Positive scale, default 100 for a percentage. |
confianca |
Optional confidence level. Exact intervals are available for rates, proportions and case fatality, but not for ratios. |
na_rm |
Whether rows with a missing numerator or denominator should be removed pairwise within each group. A group containing no complete row remains missing. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame with aggregated counts and 'letalidade'.
dados <- data.frame(doenca = c("A", "A"), obitos = c(1, 2), casos = c(20, 30)) letalidade(dados, "obitos", "casos", grupo = "doenca")dados <- data.frame(doenca = c("A", "A"), obitos = c(1, 2), casos = c(20, 30)) letalidade(dados, "obitos", "casos", grupo = "doenca")
Calculate moving averages
media_movel( x, janela = 7L, alinhamento = c("direita", "centro", "esquerda"), parcial = FALSE, na_rm = FALSE )media_movel( x, janela = 7L, alinhamento = c("direita", "centro", "esquerda"), parcial = FALSE, na_rm = FALSE )
x |
Numeric vector. |
janela |
Positive window size. |
alinhamento |
Window alignment: '"direita"', '"centro"' or '"esquerda"'. |
parcial |
Whether edge windows may contain fewer than 'janela' observations. |
na_rm |
Whether missing values should be removed within each window. |
A numeric vector of the same length as 'x'.
media_movel(1:7, janela = 3) media_movel(c(1, NA, 3, 4), janela = 2, na_rm = TRUE)media_movel(1:7, janela = 3) media_movel(c(1, NA, 3, 4), janela = 2, na_rm = TRUE)
Builds the official DATASUS transfer paths and optionally checks whether each file currently exists. SIM and SINASC files are annual; SIH files are monthly.
microdados_arquivos( sistema, tipo = NULL, ano, mes = NULL, uf = NULL, preliminares = TRUE, verificar = TRUE, timeout = 120 )microdados_arquivos( sistema, tipo = NULL, ano, mes = NULL, uf = NULL, preliminares = TRUE, verificar = TRUE, timeout = 120 )
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. |
A data frame containing official file names, URLs and existence checks. Provenance records the selection and consultation time.
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)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)
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 )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)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)
Returns the local catalog of raw DBC/DBF file families supported by the package. These files provide record-level data, unlike aggregated TABNET results.
microdados_catalogo(sistema = NULL)microdados_catalogo(sistema = NULL)
sistema |
Optional system: '"sim"', '"sinasc"' or '"sih"'. |
A data frame with system, upstream source, file type, description, geographic scope and frequency.
microdados_catalogo() microdados_catalogo("sih")microdados_catalogo() microdados_catalogo("sih")
Downloads the requested DBC files and reads them directly in memory using the native 'datasusr' decoder. Column selection and 'n_max' are applied during parsing, which is useful for large SIH files.
microdados_ler( sistema, tipo = NULL, ano, mes = NULL, uf = NULL, destino = NULL, cache = TRUE, atualizar = FALSE, preliminares = TRUE, verificar = TRUE, timeout = 240, colunas = NULL, n_max = Inf, normalizar = FALSE, juntar = TRUE, ... )microdados_ler( sistema, tipo = NULL, ano, mes = NULL, uf = NULL, destino = NULL, cache = TRUE, atualizar = FALSE, preliminares = TRUE, verificar = TRUE, timeout = 240, colunas = NULL, n_max = Inf, normalizar = FALSE, juntar = TRUE, ... )
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. |
colunas |
Optional vector of original or lower-case columns to read. |
n_max |
Maximum number of records to read from each file. |
normalizar |
Whether to rename and type common fields with [datasus_padronizar()]. |
juntar |
Whether to combine multiple files. If 'FALSE', returns a named list. |
... |
Additional arguments passed to [datasusr::read_datasus_dbc()]. |
A data frame, or a named list when 'juntar = FALSE', with provenance metadata attached.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ admissions <- microdados_ler( "sih", ano = 2024, mes = 1, uf = "AC", colunas = c("MUNIC_RES", "DT_INTER", "DIAG_PRINC", "VAL_TOT"), n_max = 1000, normalizar = TRUE ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ admissions <- microdados_ler( "sih", ano = 2024, mes = 1, uf = "AC", colunas = c("MUNIC_RES", "DT_INTER", "DIAG_PRINC", "VAL_TOT"), n_max = 1000, normalizar = TRUE ) }) options(old_options)
Validates current territorial identifiers against the bundled IBGE reference. Municipality inputs may use the full seven-digit IBGE code or the six-digit form commonly returned by DATASUS. State and region inputs may also use abbreviations or full names.
normalizar_codigo_ibge( codigo, nivel = c("municipio", "uf", "regiao"), formato = NULL, desconhecido = c("erro", "na", "manter") )normalizar_codigo_ibge( codigo, nivel = c("municipio", "uf", "regiao"), formato = NULL, desconhecido = c("erro", "na", "manter") )
codigo |
Vector of territorial identifiers. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
formato |
Output format. Municipalities support '"ibge"' (seven digits) and '"datasus"' (six digits). States and regions additionally support '"sigla"' and '"nome"'. |
desconhecido |
How to handle unknown values: '"erro"', '"na"' or '"manter"'. |
A character vector with the same length as 'codigo'.
normalizar_codigo_ibge(c("500270", "5003702")) normalizar_codigo_ibge(c("MS", "Mato Grosso do Sul"), "uf", "ibge")normalizar_codigo_ibge(c("500270", "5003702")) normalizar_codigo_ibge(c("MS", "Mato Grosso do Sul"), "uf", "ibge")
Downloads annual records from the e-SUS Notifica Hospital Admissions module. The published files cover SUS clinical and intensive-care beds allocated to suspected or confirmed COVID-19 cases. Fields added in 2022 are not populated in earlier records.
ocupacao_hospitalar( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )ocupacao_hospitalar( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )
ano |
Resource year or '"last"' for the latest year currently published. |
formato |
File format, '"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local OpenDataSUS cache. |
atualizar |
Whether to force a fresh metadata query and download. |
n_max |
Maximum number of rows to read. |
colunas |
Optional character vector selecting columns during CSV parsing. |
normalizar |
Whether to apply the curated contemporary schema with [datasus_padronizar()]. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource with provenance metadata.
OpenDataSUS. Registro de Ocupação Hospitalar COVID-19. https://dadosabertos.saude.gov.br/dataset/registro-de-ocupacao-hospitalar-covid-19
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ leitos <- ocupacao_hospitalar(ano = 2022, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ leitos <- ocupacao_hospitalar(ano = 2022, n_max = 1000) }) options(old_options)
Some OpenDataSUS resources, notably state-level influenza-like illness datasets, publish several file parts as links inside the resource description instead of the primary URL field. This function expands both representations to one row per downloadable file.
opendatasus_arquivos( conjunto, recurso = NULL, formato = NULL, cache = TRUE, atualizar = FALSE )opendatasus_arquivos( conjunto, recurso = NULL, formato = NULL, cache = TRUE, atualizar = FALSE )
conjunto |
Dataset slug returned by [opendatasus_catalogo()]. |
recurso |
Optional exact resource name or identifier. |
formato |
Optional resource format. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
A data frame with one row per downloadable file and its parent resource identifier, part number and URL.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_arquivos( "notificacoes-de-sindrome-gripal-leve-2024", recurso = "Dados MS - 20/12", formato = "CSV" ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_arquivos( "notificacoes-de-sindrome-gripal-leve-2024", recurso = "Dados MS - 20/12", formato = "CSV" ) }) options(old_options)
Resolves a resource from the live portal metadata, downloads it atomically and records its origin and MD5 checksum. By default, files are reused from the package cache. A cached file is refreshed automatically when the resource update timestamp changes.
opendatasus_baixar( conjunto, recurso = NULL, ano = "last", formato = NULL, destino = NULL, cache = TRUE, atualizar = FALSE )opendatasus_baixar( conjunto, recurso = NULL, ano = "last", formato = NULL, destino = NULL, cache = TRUE, atualizar = FALSE )
conjunto |
Dataset slug returned by [opendatasus_catalogo()]. |
recurso |
Optional exact resource name or stable resource identifier. |
ano |
Resource year, '"last"' for the latest dated resource, or 'NULL'. Ignored when 'recurso' is supplied. |
formato |
Resource format. When both 'recurso' and 'formato' are 'NULL', CSV is preferred. |
destino |
Optional destination file or existing directory. 'NULL' uses the package cache, or a temporary file when 'cache = FALSE'. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
The normalized local file path, with classes '"datasus_arquivo"' and '"character"'. Use [datasus_proveniencia()] to inspect its origin.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ file <- opendatasus_baixar( "arboviroses-dengue", ano = 2025, formato = "CSV" ) datasus_proveniencia(file) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ file <- opendatasus_baixar( "arboviroses-dengue", ano = 2025, formato = "CSV" ) datasus_proveniencia(file) }) options(old_options)
Searches the current OpenDataSUS portal and returns lightweight metadata for matching datasets. Use [opendatasus_recursos()] to inspect the files and API links published for one dataset.
opendatasus_catalogo( busca = NULL, grupo = NULL, formato = NULL, pagina = 1L, limite = 20L, cache = TRUE, atualizar = FALSE )opendatasus_catalogo( busca = NULL, grupo = NULL, formato = NULL, pagina = 1L, limite = 20L, cache = TRUE, atualizar = FALSE )
busca |
Optional free-text search. |
grupo |
Optional OpenDataSUS group slug. |
formato |
Optional resource format, such as '"CSV"', '"JSON"' or '"PDF"'. |
pagina |
Positive page number. |
limite |
Number of results requested per page. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
A data frame with dataset names, titles, descriptions, formats and groups. Attribute '"datasus_proveniencia"' records the source and consultation time.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_catalogo("dengue") opendatasus_catalogo(grupo = "arboviroses", formato = "CSV") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_catalogo("dengue") opendatasus_catalogo(grupo = "arboviroses", formato = "CSV") }) options(old_options)
Selects and downloads one CSV or JSON resource, then reads it into R. CSV delimiters are detected automatically. For very large datasets, use 'n_max' while exploring the columns, or call [opendatasus_baixar()] and use a streaming database engine.
opendatasus_ler( conjunto, recurso = NULL, ano = "last", formato = NULL, destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, ... )opendatasus_ler( conjunto, recurso = NULL, ano = "last", formato = NULL, destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, ... )
conjunto |
Dataset slug returned by [opendatasus_catalogo()]. |
recurso |
Optional exact resource name or stable resource identifier. |
ano |
Resource year, '"last"' for the latest dated resource, or 'NULL'. Ignored when 'recurso' is supplied. |
formato |
Resource format. When both 'recurso' and 'formato' are 'NULL', CSV is preferred. |
destino |
Optional destination file or existing directory. 'NULL' uses the package cache, or a temporary file when 'cache = FALSE'. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
n_max |
Maximum number of CSV rows to read. For JSON data, the limit is applied after parsing when the result is a data frame. |
colunas |
Optional character vector selecting columns while CSV files are parsed. JSON columns are selected after parsing. |
... |
Additional arguments passed to [readr::read_delim()] or [jsonlite::fromJSON()]. |
The parsed resource. Attribute '"datasus_proveniencia"' records the selected resource, download time, local file and checksum.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ dengue <- opendatasus_ler( "arboviroses-dengue", ano = 2025, formato = "CSV", n_max = 1000 ) datasus_proveniencia(dengue) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ dengue <- opendatasus_ler( "arboviroses-dengue", ano = 2025, formato = "CSV", n_max = 1000 ) datasus_proveniencia(dengue) }) options(old_options)
Downloads the selected resource using the regular atomic cache, expands multipart resources, and invokes a callback for bounded-size chunks. Returning small summaries or 'NULL' from the callback keeps memory use independent of the complete dataset size.
opendatasus_processar( conjunto, FUN, recurso = NULL, ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, colunas = NULL, tamanho_bloco = 100000L, sistema = NULL, ... )opendatasus_processar( conjunto, FUN, recurso = NULL, ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, colunas = NULL, tamanho_bloco = 100000L, sistema = NULL, ... )
conjunto |
Dataset slug returned by [opendatasus_catalogo()]. |
FUN |
Function called as 'FUN(dados, posicao, arquivo)', where 'posicao' is the first row position within a file and 'arquivo' is the one-based file-part index. |
recurso |
Optional exact resource name or stable resource identifier. |
ano |
Resource year, '"last"' for the latest dated resource, or 'NULL'. Ignored when 'recurso' is supplied. |
formato |
Resource format. When both 'recurso' and 'formato' are 'NULL', CSV is preferred. |
destino |
Optional destination file or existing directory. 'NULL' uses the package cache, or a temporary file when 'cache = FALSE'. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
colunas |
Optional character vector selecting columns while CSV files are parsed. JSON columns are selected after parsing. |
tamanho_bloco |
Positive number of rows parsed per chunk. |
sistema |
Optional dictionary system accepted by [datasus_padronizar()]. When supplied, each chunk is standardized before 'FUN' is called. |
... |
Additional arguments passed to [readr::read_delim()] or [jsonlite::fromJSON()]. |
An object of class '"datasus_processamento"' containing callback results, row, chunk and file counts, and provenance for every file.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ summary <- opendatasus_processar( "doses-aplicadas-pelo-programa-de-nacional-de-imunizacoes-pni-2026", recurso = "Vacinação - Julho 2026", ano = NULL, formato = "CSV", FUN = function(dados, posicao, arquivo) nrow(dados), tamanho_bloco = 50000 ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ summary <- opendatasus_processar( "doses-aplicadas-pelo-programa-de-nacional-de-imunizacoes-pni-2026", recurso = "Vacinação - Julho 2026", ano = NULL, formato = "CSV", FUN = function(dados, posicao, arquivo) nrow(dados), tamanho_bloco = 50000 ) }) options(old_options)
List resources from an OpenDataSUS dataset
opendatasus_recursos(conjunto, cache = TRUE, atualizar = FALSE)opendatasus_recursos(conjunto, cache = TRUE, atualizar = FALSE)
conjunto |
Dataset slug returned by [opendatasus_catalogo()]. |
cache |
Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'. |
atualizar |
Whether to ignore cached metadata and query the portal again. |
A data frame with one row per published resource, including its stable identifier, name, format, inferred year, URL and update date.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_recursos("srag-2019-a-2026") opendatasus_recursos("arboviroses-dengue") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ opendatasus_recursos("srag-2019-a-2026") opendatasus_recursos("arboviroses-dengue") }) options(old_options)
Calculates a weighted average of age-specific rates using a supplied standard population. Independent Poisson counts are assumed for the standard error. Optional confidence limits use a normal approximation.
padronizar_idade( eventos, populacao, idade, populacao_padrao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE )padronizar_idade( eventos, populacao, idade, populacao_padrao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE )
eventos |
Non-negative event counts by age stratum. |
populacao |
Positive population or person-time by age stratum. |
idade |
Age-stratum labels. |
populacao_padrao |
Standard population weights. Supply either one value per input row or a named vector whose names match 'idade'. |
grupo |
Optional analysis group, such as year or municipality. Each age stratum must occur at most once within a group. |
multiplicador |
Scale of the standardized rate, default 100,000. |
confianca |
Optional confidence level. 'NULL' omits confidence limits. |
na_rm |
Whether incomplete age strata should be removed and the remaining standard weights renormalized. |
A data frame with standardized rate, standard error, confidence limits, number of strata and proportion of standard weight represented.
Ahmad OB et al. (2001). Age standardization of rates: a new WHO standard. World Health Organization.
padronizar_idade( eventos = c(10, 40), populacao = c(1000, 1000), idade = c("0-49", "50+"), populacao_padrao = c("0-49" = 800, "50+" = 200) )padronizar_idade( eventos = c(10, 40), populacao = c(1000, 1000), idade = c("0-49", "50+"), populacao_padrao = c("0-49" = 800, "50+" = 200) )
Downloads anonymous vaccination records published in monthly files by the National Immunization Program. This record-level source complements the aggregated historical TABNET series returned by [pni_imunizacoes()].
pni_doses( ano = "last", mes = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )pni_doses( ano = "last", mes = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, colunas = NULL, normalizar = FALSE, ... )
ano |
Dataset year from 2020 onwards, or '"last"' for the most recent annual dataset currently published. |
mes |
Month number, Portuguese month name, or '"last"' for the latest month currently published in the selected year and format. |
formato |
File format, '"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local OpenDataSUS cache. |
atualizar |
Whether to force a fresh metadata query and download. |
n_max |
Maximum number of rows to read. |
colunas |
Optional character vector selecting columns during CSV parsing. |
normalizar |
Whether to apply the curated contemporary schema with [datasus_padronizar()]. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource with provenance metadata.
OpenDataSUS. Doses aplicadas pelo Programa Nacional de Imunizações. https://dadosabertos.saude.gov.br/dataset?query=doses+aplicadas+PNI
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ doses <- pni_doses(ano = 2025, mes = 1, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ doses <- pni_doses(ano = 2025, mes = 1, n_max = 1000) }) options(old_options)
Provides applied doses and vaccination coverage from the legacy TABNET series, whose latest available year is currently 2022. DATASUS reports that coverage and applied-dose data are under review for integration inconsistencies.
pni_imunizacoes( conjunto = "doses_aplicadas", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )pni_imunizacoes( conjunto = "doses_aplicadas", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ pni_imunizacoes(uf = "MS") pni_imunizacoes( conjunto = "cobertura", uf = "MS", periodo = 2022 ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ pni_imunizacoes(uf = "MS") pni_imunizacoes( conjunto = "cobertura", uf = "MS", periodo = 2022 ) }) options(old_options)
Returns age-group weights for the WHO 2000–2025 world standard, Segi's world standard or the Scandinavian standard. By default weights are normalized to sum to one and can be passed directly to [padronizar_idade()].
populacao_padrao( nome = "oms_2000_2025", formato = c("vetor", "dados"), normalizar = TRUE )populacao_padrao( nome = "oms_2000_2025", formato = c("vetor", "dados"), normalizar = TRUE )
nome |
Standard population: '"oms_2000_2025"', '"segi"' or '"escandinava"'. '"oms"' and '"who"' are accepted aliases. |
formato |
Output as a named numeric '"vetor"' or a data frame ('"dados"'). |
normalizar |
Whether weights should be normalized to sum to one. |
A named numeric vector or a data frame with 'faixa_etaria', 'peso_publicado' and 'peso'.
Ahmad OB et al. (2001). Age standardization of rates: a new WHO standard. https://cdn.who.int/media/docs/default-source/gho-documents/global-health-estimates/gpe_discussion_paper_series_paper31_2001_age_standardization_rates.pdf
populacao_padrao("oms") populacao_padrao("segi", formato = "dados")populacao_padrao("oms") populacao_padrao("segi", formato = "dados")
Provides census, projection, retroprojection and municipal estimate datasets published in the DATASUS population section. The default dataset contains municipal estimates by sex and age from 2000 through 2021.
populacao_residente( conjunto = "estimativa_municipal", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )populacao_residente( conjunto = "estimativa_municipal", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ populacao_residente(uf = "MS", periodo = 2021) populacao_residente( linha = "Unidade da Federação", periodo = c(2020, 2021) ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ populacao_residente(uf = "MS", periodo = 2021) populacao_residente( linha = "Unidade da Federação", periodo = c(2020, 2021) ) }) options(old_options)
Calculate grouped proportions
proporcao( dados, parte, total, grupo = NULL, multiplicador = 100, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )proporcao( dados, parte, total, grupo = NULL, multiplicador = 100, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )
dados |
A non-empty data frame. |
parte |
Name of the subset count column. |
total |
Name of the total count column. |
grupo |
Optional character vector naming grouping columns. |
multiplicador |
Positive scale, default 100 for a percentage. |
confianca |
Optional confidence level. Exact intervals are available for rates, proportions and case fatality, but not for ratios. |
na_rm |
Whether rows with a missing numerator or denominator should be removed pairwise within each group. A group containing no complete row remains missing. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame with aggregated counts and 'proporcao'.
dados <- data.frame(ano = c(2024, 2024), vacinados = c(40, 45), elegiveis = c(50, 50)) proporcao(dados, "vacinados", "elegiveis", grupo = "ano")dados <- data.frame(ano = c(2024, 2024), vacinados = c(40, 45), elegiveis = c(50, 50)) proporcao(dados, "vacinados", "elegiveis", grupo = "ano")
Epidemiological weeks run from Sunday through Saturday. Week 1 is the Sunday-to-Saturday week containing at least four days of the new year. Dates near New Year can therefore belong to the previous or following epidemiological year.
semana_epidemiologica(data)semana_epidemiologica(data)
data |
A 'Date', date-time, or vector of ISO '"YYYY-MM-DD"' strings. |
A data frame containing the original date, epidemiological year and week, week start and end, and a stable '"YYYY-Www"' code.
Brazilian Ministry of Health, SINAN Epidemiological Calendar: https://portalsinan.saude.gov.br/calendario-epidemiologico
semana_epidemiologica(as.Date(c("2025-01-01", "2026-01-01")))semana_epidemiologica(as.Date(c("2025-01-01", "2026-01-01")))
Query ambulatory production from SIA/SUS
sia_producao( conjunto = "atendimento", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sia_producao( conjunto = "atendimento", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sia_producao(uf = "MS") sia_producao( linha = "UF", conteudo = "Qtd.aprovada", periodo = "last" ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sia_producao(uf = "MS") sia_producao( linha = "UF", conteudo = "Qtd.aprovada", periodo = "last" ) }) options(old_options)
Read SIH hospitalization microdata
sih_microdados(ano, mes, uf, tipo = "RD", ...)sih_microdados(ano, mes, uf, tipo = "RD", ...)
ano |
One or more years. |
mes |
One or more months. |
uf |
One or more state abbreviations. |
tipo |
SIH file type, default '"RD"'. |
... |
Additional arguments passed to [microdados_ler()]. |
Record-level SIH data.
Provides general morbidity and external-causes views by place of hospitalization or residence. Use 'datasus_catalogo("sih")' and select rows whose category is '"morbidade hospitalar"' to list the datasets.
sih_morbidade( conjunto = "geral_internacao", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sih_morbidade( conjunto = "geral_internacao", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sih_morbidade(uf = "MS") sih_morbidade( uf = "MS", linha = "Capítulo CID-10", conteudo = "Internações", periodo = 2025 ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sih_morbidade(uf = "MS") sih_morbidade( uf = "MS", linha = "Capítulo CID-10", conteudo = "Internações", periodo = 2025 ) }) options(old_options)
Query hospital production from SIH/SUS
sih_producao( conjunto = "aih_rd_internacao", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sih_producao( conjunto = "aih_rd_internacao", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sih_producao(uf = "MS") sih_producao( uf = "MS", linha = "Município", conteudo = "Internações", periodo = 2025, filtros = list(carater_atendimento = "Urgência") ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sih_producao(uf = "MS") sih_producao( uf = "MS", linha = "Município", conteudo = "Internações", periodo = 2025, filtros = list(carater_atendimento = "Urgência") ) }) options(old_options)
Provides a single interface to the mortality tables of the Mortality Information System (SIM). Available datasets are listed by 'datasus_catalogo("sim")'; current row, column, measure, period and filter choices can be inspected with 'datasus_opcoes("sim", ...)'.
sim( conjunto = "obitos", abrangencia = c("municipio", "uf"), uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sim( conjunto = "obitos", abrangencia = c("municipio", "uf"), uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
SIM dataset: '"obitos"', '"mortalidade_infantil"', '"causas_evitaveis_0_4"' or '"causas_evitaveis_5_74"'. |
abrangencia |
Geographic form: '"municipio"' for municipality-level results or '"uf"' for region/state-level results. |
uf |
Optional state abbreviation, two-digit IBGE code or state name. With 'abrangencia = "municipio"', selects the state-specific municipal form. It must be 'NULL' with 'abrangencia = "uf"'. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value or one-based index. |
periodo |
'"last"' for the latest available year, an exact period label or raw value, a four-digit year, or a vector of these values. |
filtros |
Named list of filters. Use [datasus_opcoes()] to inspect their names and accepted values. |
A data frame containing the TABNET result, with query provenance available through [datasus_proveniencia()].
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ datasus_catalogo("sim") op <- datasus_opcoes( "sim", "obitos", abrangencia = "uf" ) obitos <- sim( conjunto = "obitos", abrangencia = "uf", periodo = 2024, filtros = list(sexo = "Masculino") ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ datasus_catalogo("sim") op <- datasus_opcoes( "sim", "obitos", abrangencia = "uf" ) obitos <- sim( conjunto = "obitos", abrangencia = "uf", periodo = 2024, filtros = list(sexo = "Masculino") ) }) options(old_options)
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes data focused on the regions and states.
sim_evita10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evita10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Regiãoo". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Nãoo ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
regiao |
"all" or a numeric vector with the IBGE's region codes to filter the data. Defaults to "all". |
unidade_da_federacao |
"all" or a numeric vector with the IBGE's state codes to filter the data. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_evita10_bruf(regiao = 5) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_evita10_bruf(regiao = 5) }) options(old_options)
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes data focused on brazilian cities.
sim_evita10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evita10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
capital |
"all" or a numeric vector with the IBGE's cities codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
territorio_da_cidadania |
"all" or a numeric vector with the territory of citizenship codes to filter the data. Defaults to "all". |
mesorregiao_pndr |
"all" or a numeric vector with the PNDR's mesoregion codes to filter the data. Defaults to "all". |
amazonia_legal |
"all" or a character ("Sim" or "Não") indicating if only the Legal Amazon region must be included. Defaults to "all". |
semiarido |
"all" or a character ("Sim" or "Não") indicating if only the semiarid region must be included. Defaults to "all". |
faixa_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border area must be included. Defaults to "all". |
zona_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border strip must be included. Defaults to "all". |
municipio_de_extrema_pobreza |
"all" or a character ("Sim" or "Não") indicating if only the municipalities of extreme poverty must be included. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_evita10_mun(municipio = 500270) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_evita10_mun(municipio = 500270) }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes in 0-4 age group data from the states unities.
sim_evita10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evita10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
uf |
A character of length = 1 with the state's acronym of interest. |
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
divisao_admnist_estadual |
"all" or a numeric vector with the State administrative division's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_evita10_uf(uf = "ms") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_evita10_uf(uf = "ms") }) options(old_options)
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes data focused on the regions and states and age ranging between 5-74 years old.
sim_evitb10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evitb10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Região". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
regiao |
"all" or a numeric vector with the IBGE's region codes to filter the data. Defaults to "all". |
unidade_da_federacao |
"all" or a numeric vector with the IBGE's state codes to filter the data. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_evitb10_bruf(region = 5) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_evitb10_bruf(region = 5) }) options(old_options)
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes data focused on brazilian cities and age ranging between 5-74 years old.
sim_evitb10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evitb10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
capital |
"all" or a numeric vector with the IBGE's cities codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
territorio_da_cidadania |
"all" or a numeric vector with the territory of citizenship codes to filter the data. Defaults to "all". |
mesorregiao_pndr |
"all" or a numeric vector with the PNDR's mesoregion codes to filter the data. Defaults to "all". |
amazonia_legal |
"all" or a character ("Sim" or "Não") indicating if only the Legal Amazon region must be included. Defaults to "all". |
semiarido |
"all" or a character ("Sim" or "Não") indicating if only the semiarid region must be included. Defaults to "all". |
faixa_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border area must be included. Defaults to "all". |
zona_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border strip must be included. Defaults to "all". |
municipio_de_extrema_pobreza |
"all" or a character ("Sim" or "Não") indicating if only the municipalities of extreme poverty must be included. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_evitb10_mun(municipio = 500270) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_evitb10_mun(municipio = 500270) }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to evitable causes in 5-74 age group data from the states unities.
sim_evitb10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_evitb10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", causas_evitaveis = "all", capitulo_cid10 = "all", categoria_cid10 = "all", faixa_etaria = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
uf |
A character of length = 1 with the state's acronym of interest. |
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
divisao_admnist_estadual |
"all" or a numeric vector with the State administrative division's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
causas_evitaveis |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_evitb10_uf(uf = "ms") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_evitb10_uf(uf = "ms") }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to child mortality data focused on focused on the regions and states.
sim_inf10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", causas_evitaveis_0a4anos = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")sim_inf10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", causas_evitaveis_0a4anos = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
regiao |
"all" or a numeric vector with the IBGE's region codes to filter the data. Defaults to "all". |
unidade_da_federacao |
"all" or a numeric vector with the IBGE's state codes to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
lista_mort_cid10 |
"all" or a character vector with the mortality type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
causa_mal_definidas |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
causas_evitaveis_0a4anos |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_1 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_2 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_3 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_4 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_5 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_relacao_parto |
"all" or a character vector with period of child mortality in relation to childbirth (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_investigado |
"all" or a character vector indicating if the death was investigated (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_inf10_bruf(regiao = 5) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_inf10_bruf(regiao = 5) }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to child mortality data focused on brazilian cities.
sim_inf10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", causas_evitaveis_0a4anos = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")sim_inf10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", causas_evitaveis_0a4anos = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
capital |
"all" or a numeric vector with the IBGE's cities codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
territorio_da_cidadania |
"all" or a numeric vector with the territory of citizenship codes to filter the data. Defaults to "all". |
mesorregiao_pndr |
"all" or a numeric vector with the PNDR's mesoregion codes to filter the data. Defaults to "all". |
amazonia_legal |
"all" or a character ("Sim" or "Não") indicating if only the Legal Amazon region must be included. Defaults to "all". |
semiarido |
"all" or a character ("Sim" or "Não") indicating if only the semiarid region must be included. Defaults to "all". |
faixa_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border area must be included. Defaults to "all". |
zona_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border strip must be included. Defaults to "all". |
municipio_de_extrema_pobreza |
"all" or a character ("Sim" or "Não") indicating if only the municipalities of extreme poverty must be included. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
lista_mort_cid10 |
"all" or a character vector with the mortality type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
causa_mal_definidas |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
causas_evitaveis_0a4anos |
"all" or a character vector with the evitable cause code (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_1 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_2 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_3 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_4 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_5 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_relacao_parto |
"all" or a character vector with period of child mortality in relation to childbirth (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_investigado |
"all" or a character vector indicating if the death was investigated (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_inf10_mun(municipio = 500270) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_inf10_mun(municipio = 500270) }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to child mortality data from the states unities.
sim_inf10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")sim_inf10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", capitulo_cid10 = "all", categoria_cid10 = "all", lista_mort_cid10 = "all", causa_mal_definidas = "all", faixa_etaria_1 = "all", faixa_etaria_2 = "all", faixa_etaria_3 = "all", faixa_etaria_4 = "all", faixa_etaria_5 = "all", faixa_etaria_detalhada = "all", sexo = "all", cor_raca = "all", local_ocorrencia = "all", idade_mae = "all", escolaridade_mae = "all", duracao_gestacao = "all", tipo_gravidez = "all", tipo_parto = "all", peso_ao_nascer = "all", obito_relacao_parto = "all", obito_investigado = "all")
uf |
A character of length = 1 with the state"all". |
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
divisao_admnist_estadual |
"all" or a numeric vector with the State administrative division's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
lista_mort_cid10 |
"all" or a character vector with the mortality type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
causa_mal_definidas |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_1 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_2 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_3 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_4 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_5 |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_detalhada |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_relacao_parto |
"all" or a character vector with period of child mortality in relation to childbirth (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
obito_investigado |
"all" or a character vector indicating if the death was investigated (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_inf10_uf(uf = "ms") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_inf10_uf(uf = "ms") }) options(old_options)
Read SIM death microdata
sim_microdados(ano, uf = NULL, tipo = "DO", ...)sim_microdados(ano, uf = NULL, tipo = "DO", ...)
ano |
One or more years. |
uf |
One or more state abbreviations. |
tipo |
SIM file type, default '"DO"'. |
... |
Additional arguments passed to [microdados_ler()]. |
Record-level SIM data.
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to data focused on the regions and states.
sim_obt10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_obt10_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Região". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
regiao |
"all" or a numeric vector with the IBGE's region codes to filter the data. Defaults to "all". |
unidade_da_federacao |
"all" or a numeric vector with the IBGE's state codes to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
grupo_cid10 |
"all" or a character vector with the ICD-10 group (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
causa_br_cid10 |
"all" or a character vector with the ICD-10 cause codes to filter the data. Defaults to "all". |
causa_mal_definida |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_ops |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". "ops" in the argument name stands for Pan American Health Organization. |
faixa_etaria_det |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_menor1a |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_obt10_bruf(region = 5) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sim_obt10_bruf(region = 5) }) options(old_options)
This function allows the user to retrieve data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to data focused on brazilian cities.
sim_obt10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_obt10_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
capital |
"all" or a numeric vector with the IBGE's cities codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
territorio_da_cidadania |
"all" or a numeric vector with the territory of citizenship codes to filter the data. Defaults to "all". |
mesorregiao_pndr |
"all" or a numeric vector with the PNDR's mesoregion codes to filter the data. Defaults to "all". |
amazonia_legal |
"all" or a character ("Sim" or "Não") indicating if only the Legal Amazon region must be included. Defaults to "all". |
semiarido |
"all" or a character ("Sim" or "Não") indicating if only the semiarid region must be included. Defaults to "all". |
faixa_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border area must be included. Defaults to "all". |
zona_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border strip must be included. Defaults to "all". |
municipio_de_extrema_pobreza |
"all" or a character ("Sim" or "Não") indicating if only the municipalities of extreme poverty must be included. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
grupo_cid10 |
"all" or a character vector with the ICD-10 group (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
causa_br_cid10 |
"all" or a character vector with the ICD-10 cause codes to filter the data. Defaults to "all". |
causa_mal_definida |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_ops |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". "ops" in the argument name stands for Pan American Health Organization. |
faixa_etaria_det |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_menor1a |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_obt10_mun(municipio = 500270) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sim_obt10_mun(municipio = 500270) }) options(old_options)
This function allows the user to retrive data from SIM's ICD-10 database much in the same way that is done by the online portal. The argument options refer to data from the states unities.
sim_obt10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")sim_obt10_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", capitulo_cid10 = "all", grupo_cid10 = "all", categoria_cid10 = "all", causa_br_cid10 = "all", causa_mal_definida = "all", faixa_etaria = "all", faixa_etaria_ops = "all", faixa_etaria_det = "all", faixa_etaria_menor1a = "all", sexo = "all", cor_raca = "all", escolaridade = "all", estado_civil = "all", local_ocorrencia = "all")
uf |
A character of length = 1 with the state's acronym of interest. |
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
divisao_admnist_estadual |
"all" or a numeric vector with the State administrative division's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
capitulo_cid10 |
"all" or a numeric vector with the ICD-10 chapter to filter the data. Defaults to "all". |
grupo_cid10 |
"all" or a character vector with the ICD-10 group (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
categoria_cid10 |
"all" or a character vector with the ICD-10 category codes (capital letter and two numbers) to filter the data. Defaults to "all". |
causa_br_cid10 |
"all" or a character vector with the ICD-10 cause codes to filter the data. Defaults to "all". |
causa_mal_definida |
"all" or a character vector with the ill-defined causes (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_ops |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". "ops" in the argument name stands for Pan American Health Organization. |
faixa_etaria_det |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
faixa_etaria_menor1a |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
escolaridade |
"all" or a character vector with the instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil |
"all" or a character vector with the marital status (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_obt10_uf(uf = "ms") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sim_obt10_uf(uf = "ms") }) options(old_options)
Supports the disease-specific TABNET datasets listed by 'datasus_catalogo("sinan")'. Because each disease has its own form, inspect dimensions, periods and filters with 'datasus_opcoes("sinan", agravo)'. Febre amarela is not included because its official link points to a separate open-data platform rather than a TABNET form.
sinan( agravo = "dengue", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sinan( agravo = "dengue", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
agravo |
Notifiable disease or condition listed by 'datasus_catalogo("sinan")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest available period, an exact period label or raw value, a four-digit year, or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sinan("dengue", uf = "MS") sinan( "violencia_interpessoal_autoprovocada", uf = "MS", periodo = 2024 ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sinan("dengue", uf = "MS") sinan( "violencia_interpessoal_autoprovocada", uf = "MS", periodo = 2024 ) }) options(old_options)
Downloads the annual OpenDataSUS resources. This complements the aggregated legacy TABNET interface available from 'sinan("dengue")'.
sinan_dengue( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )sinan_dengue( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )
ano |
Dataset year or '"last"'. |
formato |
'"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local cache. |
atualizar |
Whether to force a new metadata query and download. |
n_max |
Maximum number of CSV rows to read. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ dengue <- sinan_dengue(ano = 2025, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ dengue <- sinan_dengue(ano = 2025, n_max = 1000) }) options(old_options)
Read current e-SUS SINAN Mpox microdata
sinan_mpox( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )sinan_mpox( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )
ano |
Dataset year or '"last"'. |
formato |
'"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local cache. |
atualizar |
Whether to force a new metadata query and download. |
n_max |
Maximum number of CSV rows to read. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ cases <- sinan_mpox(ano = 2025, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ cases <- sinan_mpox(ano = 2025, n_max = 1000) }) options(old_options)
Provides a single interface to the Live Birth Information System (SINASC). Current row, column, measure, period and filter choices can be inspected with 'datasus_opcoes("sinasc", ...)'.
sinasc( conjunto = "nascidos_vivos", abrangencia = c("municipio", "uf"), uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sinasc( conjunto = "nascidos_vivos", abrangencia = c("municipio", "uf"), uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
SINASC dataset. Currently '"nascidos_vivos"'. |
abrangencia |
Geographic form: '"municipio"' for municipality-level results or '"uf"' for region/state-level results. |
uf |
Optional state abbreviation, two-digit IBGE code or state name. With 'abrangencia = "municipio"', selects the state-specific municipal form. It must be 'NULL' with 'abrangencia = "uf"'. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value or one-based index. |
periodo |
'"last"' for the latest available year, an exact period label or raw value, a four-digit year, or a vector of these values. |
filtros |
Named list of filters. Use [datasus_opcoes()] to inspect their names and accepted values. |
A data frame containing the TABNET result, with query provenance available through [datasus_proveniencia()].
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ op <- datasus_opcoes( "sinasc", abrangencia = "municipio", uf = "SP" ) nascimentos <- sinasc( uf = "SP", periodo = 2024, filtros = list(sexo = "Masculino") ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ op <- datasus_opcoes( "sinasc", abrangencia = "municipio", uf = "SP" ) nascimentos <- sinasc( uf = "SP", periodo = 2024, filtros = list(sexo = "Masculino") ) }) options(old_options)
Read SINASC live birth microdata
sinasc_microdados(ano, uf = NULL, tipo = "DN", ...)sinasc_microdados(ano, uf = NULL, tipo = "DN", ...)
ano |
One or more years. |
uf |
One or more state abbreviations. |
tipo |
SIM file type, default '"DO"'. |
... |
Additional arguments passed to [microdados_ler()]. |
Record-level SINASC data.
This function allows the user to retrive data from SINASC database much in the same way that is done by the online portal. The argument options refer to data focused on the regions and states.
sinasc_nv_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")sinasc_nv_bruf(linha = "Região", coluna = "Não ativa", conteudo = 1, periodo = "last", regiao = "all", unidade_da_federacao = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
regiao |
"all" or a numeric vector with the IBGE's region codes to filter the data. Defaults to "all". |
unidade_da_federacao |
"all" or a numeric vector with the IBGE's state codes to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_da_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
instrucao_da_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil_mae |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
consult_pre_natal |
"all" or a character vector with the amount of prenatal consultation (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_1_minuto |
"all" or a character vector with the value of the apgar exam of the first minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_5_minuto |
"all" or a character vector with the value of the apgar exam of the fifth minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
anomalia_congenita |
"all" or a character vector with the indicative of congenital anomaly (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_anomal_congen |
"all" or a character vector with the congenital anomaly type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sinasc_nv_bruf(region = 5) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from Midwest region sinasc_nv_bruf(region = 5) }) options(old_options)
This function allows the user to retrive data from SINASC database much in the same way that is done by the online portal. The argument options refer to data focused on brazilian cities.
sinasc_nv_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")sinasc_nv_mun(linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", capital = "all", cir = "all", macrorregiao_de_saude = "all", microrregiao_ibge = "all", ride = "all", territorio_da_cidadania = "all", mesorregiao_pndr = "all", amazonia_legal = "all", semiarido = "all", faixa_de_fronteira = "all", zona_de_fronteira = "all", municipio_de_extrema_pobreza = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
capital |
"all" or a numeric vector with the IBGE's cities codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
territorio_da_cidadania |
"all" or a numeric vector with the territory of citizenship codes to filter the data. Defaults to "all". |
mesorregiao_pndr |
"all" or a numeric vector with the PNDR's mesoregion codes to filter the data. Defaults to "all". |
amazonia_legal |
"all" or a character ("Sim" or "Não") indicating if only the Legal Amazon region must be included. Defaults to "all". |
semiarido |
"all" or a character ("Sim" or "Não") indicating if only the semiarid region must be included. Defaults to "all". |
faixa_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border area must be included. Defaults to "all". |
zona_de_fronteira |
"all" or a character ("Sim" or "Não") indicating if only the border strip must be included. Defaults to "all". |
municipio_de_extrema_pobreza |
"all" or a character ("Sim" or "Não") indicating if only the municipalities of extreme poverty must be included. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_da_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
instrucao_da_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil_mae |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
consult_pre_natal |
"all" or a character vector with the amount of prenatal consultation (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_1_minuto |
"all" or a character vector with the value of the apgar exam of the first minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_5_minuto |
"all" or a character vector with the value of the apgar exam of the fifth minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
anomalia_congenita |
"all" or a character vector with the indicative of congenital anomaly (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_anomal_congen |
"all" or a character vector with the congenital anomaly type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sinasc_nv_mun(municipio = 500270) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the city of Campo Grande/MS sinasc_nv_mun(municipio = 500270) }) options(old_options)
This function allows the user to retrive data from SINASC database much in the same way that is done by the online portal. The argument options refer to data from the states unities.
sinasc_nv_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")sinasc_nv_uf(uf, linha = "Município", coluna = "Não ativa", conteudo = 1, periodo = "last", municipio = "all", cir = "all", macrorregiao_de_saude = "all", divisao_admnist_estadual = "all", microrregiao_ibge = "all", ride = "all", local_ocorrencia = "all", idade_da_mae = "all", instrucao_da_mae = "all", estado_civil_mae = "all", duracao_gestacao = "all", tipo_de_gravidez = "all", tipo_de_parto = "all", consult_pre_natal = "all", sexo = "all", cor_raca = "all", apgar_1_minuto = "all", apgar_5_minuto = "all", peso_ao_nascer = "all", anomalia_congenita = "all", tipo_anomal_congen = "all")
uf |
A character of length = 1 with the state's acronym of interest. |
linha |
A character describing which element will be displayed in the rows of the data.frame. Defaults to "Município". |
coluna |
A character describing which element will be displayed in the columns of the data.frame. Defaults to "Não ativa". |
conteudo |
A character of length = 1 with the state's acronym of interest. |
periodo |
A character vector describing the period of data. Defaults to the last available. |
municipio |
"all" or a numeric vector with the IBGE's city codes codes to filter the data. Defaults to "all". |
cir |
"all" or a numeric vector with the CIR's codes to filter the data. Defaults to "all". |
macrorregiao_de_saude |
"all" or a numeric vector with the Health macro-region's codes to filter the data. Defaults to "all". |
divisao_admnist_estadual |
"all" or a numeric vector with the State administrative division's codes to filter the data. Defaults to "all". |
microrregiao_ibge |
"all" or a numeric vector with the IBGE's micro-region codes to filter the data. Defaults to "all". |
ride |
"all" or a numeric vector with the IBGE's metropolitan-region codes to filter the data. Defaults to "all". |
local_ocorrencia |
"all" or a character vector with the place of ocurrence to filter the data. Defaults to "all". |
idade_da_mae |
"all" or a character vector with the age range (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
instrucao_da_mae |
"all" or a character vector with the mother's instruction (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
estado_civil_mae |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
duracao_gestacao |
"all" or a character vector with the marital status of the mother (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_gravidez |
"all" or a character vector with the type of pregnancy (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_de_parto |
"all" or a character vector with the Parturition type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
consult_pre_natal |
"all" or a character vector with the amount of prenatal consultation (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
sexo |
"all" or a character vector with the gender (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
cor_raca |
"all" or a character vector with the color/race (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_1_minuto |
"all" or a character vector with the value of the apgar exam of the first minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
apgar_5_minuto |
"all" or a character vector with the value of the apgar exam of the fifth minute (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
peso_ao_nascer |
"all" or a character vector with the birth weight (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
anomalia_congenita |
"all" or a character vector with the indicative of congenital anomaly (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
tipo_anomal_congen |
"all" or a character vector with the congenital anomaly type (written in the same way) or the number corresponding to the order of the option in the online layout to filter the data. Defaults to "all". |
The function returns a data frame printed by parameters input.
This function is deprecated. Use 'sim()' or 'sinasc()' with a named 'filtros' list. The legacy signature is retained for compatibility.
Renato Prado Siqueira [email protected]
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sinasc_nv_uf(uf = "ms") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ ## Requesting data from the state of Mato Grosso do Sul sinasc_nv_uf(uf = "ms") }) options(old_options)
Supports cervical cytology and histology, mammography, and breast cytology and histology by residence, attendance location or patient.
siscan( conjunto = "citologia_colo_residencia", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )siscan( conjunto = "citologia_colo_residencia", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ siscan(uf = "MS") siscan( conjunto = "mamografia_residencia", uf = "MS", periodo = 2025 ) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ siscan(uf = "MS") siscan( conjunto = "mamografia_residencia", uf = "MS", periodo = 2025 ) }) options(old_options)
Provides the historical TABNET series for Primary Care users and Bolsa Familia beneficiaries. These are legacy series and should not be interpreted as the current SISVAN coverage.
sisvan( conjunto = "atencao_basica", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )sisvan( conjunto = "atencao_basica", uf = NULL, linha = NULL, coluna = NULL, conteudo = 1, periodo = "last", filtros = list() )
conjunto |
Dataset name listed by 'datasus_catalogo("sih")'. |
uf |
Two-letter state abbreviation. 'NULL' uses the Brazil form. |
linha |
Row dimension. ‘NULL' selects the form’s first dimension. |
coluna |
Column dimension. 'NULL' selects '"Não ativa"'. |
conteudo |
Measure label, raw TABNET value, or one-based index. |
periodo |
'"last"' for the latest competence, an exact period label or raw value, a four-digit year (all available competences in that year), or a vector of these values. |
filtros |
Named list of filters. Names and choices are available from [datasus_opcoes()]. |
A data frame containing the TABNET result.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sisvan(uf = "MS") sisvan(conjunto = "bolsa_familia", uf = "MS") }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ sisvan(uf = "MS") sisvan(conjunto = "bolsa_familia", uf = "MS") }) options(old_options)
Read SIVEP-Gripe severe acute respiratory syndrome microdata
sivep_gripe( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )sivep_gripe( ano = "last", formato = "CSV", destino = NULL, cache = TRUE, atualizar = FALSE, n_max = Inf, ... )
ano |
Dataset year or '"last"'. |
formato |
'"CSV"' or '"JSON"'. |
destino |
Optional destination file or existing directory. |
cache |
Whether to reuse the local cache. |
atualizar |
Whether to force a new metadata query and download. |
n_max |
Maximum number of CSV rows to read. |
... |
Additional arguments passed to the underlying reader. |
The parsed OpenDataSUS resource.
old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ srag <- sivep_gripe(ano = 2025, n_max = 1000) }) options(old_options)old_options <- options( datasus.timeout = 5, datasus.download_timeout = 15, datasus.max_tries = 1 ) try({ srag <- sivep_gripe(ano = 2025, n_max = 1000) }) options(old_options)
Calculate grouped incidence rates
taxa_incidencia( dados, casos, populacao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )taxa_incidencia( dados, casos, populacao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )
dados |
A non-empty data frame. |
casos |
Name of the incident cases column. |
populacao |
Name of the population or person-time denominator column. |
grupo |
Optional character vector naming grouping columns. |
multiplicador |
Positive rate scale, default 100,000. |
confianca |
Optional confidence level. Exact intervals are available for rates, proportions and case fatality, but not for ratios. |
na_rm |
Whether rows with a missing numerator or denominator should be removed pairwise within each group. A group containing no complete row remains missing. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame with aggregated counts and 'taxa_incidencia'.
dados <- data.frame(ano = c(2024, 2024), casos = c(10, 20), populacao = c(50000, 50000)) taxa_incidencia(dados, "casos", "populacao", grupo = "ano")dados <- data.frame(ano = c(2024, 2024), casos = c(10, 20), populacao = c(50000, 50000)) taxa_incidencia(dados, "casos", "populacao", grupo = "ano")
Calculate grouped mortality rates
taxa_mortalidade( dados, obitos, populacao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )taxa_mortalidade( dados, obitos, populacao, grupo = NULL, multiplicador = 1e+05, confianca = NULL, na_rm = FALSE, zero_denominador = c("na", "erro") )
dados |
A non-empty data frame. |
obitos |
Name of the deaths column. |
populacao |
Name of the population denominator column. |
grupo |
Optional character vector naming grouping columns. |
multiplicador |
Positive rate scale, default 100,000. |
confianca |
Optional confidence level. Exact intervals are available for rates, proportions and case fatality, but not for ratios. |
na_rm |
Whether rows with a missing numerator or denominator should be removed pairwise within each group. A group containing no complete row remains missing. |
zero_denominador |
How to handle zero denominators: '"na"' returns 'NA', while '"erro"' stops. |
A data frame with aggregated counts and 'taxa_mortalidade'.
dados <- data.frame(ano = c(2024, 2024), obitos = c(3, 7), populacao = c(5000, 5000)) taxa_mortalidade(dados, "obitos", "populacao", grupo = "ano")dados <- data.frame(ano = c(2024, 2024), obitos = c(3, 7), populacao = c(5000, 5000)) taxa_mortalidade(dados, "obitos", "populacao", grupo = "ano")
Validate IBGE territorial codes
validar_codigo_ibge(codigo, nivel = c("municipio", "uf", "regiao"))validar_codigo_ibge(codigo, nivel = c("municipio", "uf", "regiao"))
codigo |
Vector of territorial identifiers. |
nivel |
Territorial level: '"municipio"', '"uf"' or '"regiao"'. |
A logical vector. Missing and unknown values return 'FALSE'.
validar_codigo_ibge(c("500270", "999999")) validar_codigo_ibge(c("MS", "XX"), "uf")validar_codigo_ibge(c("500270", "999999")) validar_codigo_ibge(c("MS", "XX"), "uf")