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
)

Arguments

path

path to the SINAVE txt file (e.g. `"DENGUE2_.txt"`, `"ZIKA2_.txt"` or `"CHIKUNGUNYA2_.txt"`).

snv_dataset

arbovirus of the dataset: `"DENV"` (dengue), `"ZIKV"` (Zika) or `"CHIKV"` (chikungunya).

year

year to keep (ANO column). If NULL (default), the most recent year in the dataset is used.

week

epidemiological weeks to keep (SEM column), e.g. `1:10` or `c(5, 6, 7)`. If NULL (default), all weeks are used.

Value

an sf object of points (EPSG:4326), one row per locality with cases.

Details

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:

cvegeo

INEGI locality key (state + municipality + locality).

nom_ent, nom_mun, nom_loc

names of the state, municipality and locality (ITER 2020).

probable

number of notified cases (probable + confirmed).

confirmado

number of confirmed cases.

altitud

altitude of the locality (m).

pobtot

total population of the locality (Census 2020).

geometry

point of the locality (EPSG:4326).

Additional columns for DENV:

DNG, DCSA, DG

cases by final diagnosis: non-severe dengue, dengue with warning signs and severe dengue.

DENV1, DENV2, DENV3, DENV4

cases by serotype (RT-PCR triplex).

See also

[rgeomex::iter_2020_loc]

Author

Felipe Antonio Dzul Manzanilla felipe.dzul.m@gmail.com

Examples

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")
} # }