Load Brazilian mortality data from the SIM system via DATASUS
Source:R/mortality.R
load_mortality.RdRetrieves mortality records from Brazil's official Mortality Information System (SIM), made available through DATASUS (Department of Informatics of the Brazilian Unified Health System). This dataset includes detailed information on deaths by cause, location, sex, age, and other demographic characteristics. Data is useful for public health research, epidemiology, and demographic analysis.
Usage
load_mortality(
dataset,
time_period,
states = "all",
raw_data = FALSE,
keep_all = FALSE,
language = "eng"
)Arguments
- dataset
A string identifying the specific mortality dataset to download. Accepted values are:
"general": General death records"fetal": Fetal deaths"external_causes": Deaths by external causes"infant": Infant deaths"maternal": Maternal deaths
- time_period
A numeric value or vector indicating the year(s) of the data to be downloaded. For example,
2020or2015:2020.- states
A string or vector of strings indicating the Brazilian state(s) for which the data should be downloaded. Use
"all"to download data for the entire country. For specific states, use abbreviations like"SP","RJ", orc("SP", "RJ").- raw_data
Logical. If
TRUE, returns the raw data exactly as provided by DATASUS. IfFALSE(default), returns a cleaned and standardized version of the dataset.- keep_all
A
booleanchoosing whether to aggregate the data by municipality, losing individual-level variables (FALSE) or to keep all original variables (TRUE). Only applies whenraw_dataisFALSE.- language
A string indicating the desired language of variable names and labels. Accepts
"eng"(default) for English or"pt"for Portuguese.