Reads a SINAVE vector-borne disease dataset (dengue, Zika or chikungunya), counts probable and confirmed cases by locality of report, and joins them to the INEGI 2020 locality catalogue (ITER 2020) to return one point per locality with cases.
cases_by_loc(
path,
snv_dataset = c("DENV", "ZIKV", "CHIKV"),
year = NULL,
week = NULL
)path to the SINAVE txt file (e.g. `"DENGUE2_.txt"`, `"ZIKA2_.txt"` or `"CHIKUNGUNYA2_.txt"`).
arbovirus of the dataset: `"DENV"` (dengue), `"ZIKV"` (Zika) or `"CHIKV"` (chikungunya).
year to keep (ANO column). If NULL (default), the most recent year in the dataset is used.
epidemiological weeks to keep (SEM column), e.g. `1:10` or `c(5, 6, 7)`. If NULL (default), all weeks are used.
an sf object of points (EPSG:4326), one row per locality with cases.
Only probable and confirmed cases are kept (`ESTATUS_CASO` 1 and 2); discarded cases are excluded. The locality key `cvegeo` (9 digits) is built from the state, municipality and locality of report (`CVE_EDO_REP` + `CVE_MPO_REP` + `CVE_LOC_REP`). Records with missing codes (`"00"`, `"000"`, `"0000"`) and localities not found in ITER 2020 are dropped.
Columns returned for every arbovirus:
INEGI locality key (state + municipality + locality).
names of the state, municipality and locality (ITER 2020).
number of notified cases (probable + confirmed).
number of confirmed cases.
altitude of the locality (m).
total population of the locality (Census 2020).
point of the locality (EPSG:4326).
Additional columns for DENV:
cases by final diagnosis: non-severe dengue, dengue with warning signs and severe dengue.
cases by serotype (RT-PCR triplex).
[rgeomex::iter_2020_loc]
if (FALSE) { # \dontrun{
den <- cases_by_loc(path = "DENGUE2_.txt", snv_dataset = "DENV")
zik <- cases_by_loc(path = "ZIKA2_.txt", snv_dataset = "ZIKV")
chik <- cases_by_loc(path = "CHIKUNGUNYA2_.txt", snv_dataset = "CHIKV")
# a specific year
den25 <- cases_by_loc(path = "DENGUE2_.txt", snv_dataset = "DENV",
year = 2025)
# epidemiological weeks 1 to 10
den_w <- cases_by_loc(path = "DENGUE2_.txt", snv_dataset = "DENV",
week = 1:10)
mapview::mapview(den, zcol = "confirmado", cex = "probable")
} # }