--- title: "Animated maps of dengue cases" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Animated maps of dengue cases} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- [Versión en español](mapas_animados.html) ## Introduction An animated map shows **how transmission moves** week by week: where it starts, where it spreads and when it fades. **densnv** has two functions: |function |unit |cases |engine | |:-----------------|:------------------------------------|:------------------------------------------------------------------------|:----------------------------------------------| |mp_animated_loc() |Locality (proportional circles) |Probable, confirmed, final diagnosis or serotype; one or several at once |ggplot2 + gifski, with optional epidemic curve | |mp_animated_mpo() |Municipality (circles or choropleth) |Confirmed (DNG, DCSA and DG) |tmap + gifski | Titles and labels are in Spanish, the language of the users of the Mexican vector-borne disease program. ``` r library(densnv) ``` ## Data ``` r path <- "DENGUE2_.txt" x <- data.table::fread(path, quote = "", fill = TRUE) ``` ## By locality: `mp_animated_loc()` It counts the cases by locality of report and epidemiological week, and draws them as proportional circles over the state (country) or municipal (state) boundaries. The size and colour scales are **the same in every frame**, so the weeks can be compared. With `curve = TRUE` it adds the epidemic curve below, with the current week marked. ### One state: Oaxaca ``` r mp_animated_loc(path = path, snv_dataset = "DENV", year = 2026, week = 1:52, var = "probable", multi = "sum", country = FALSE, cve_edo = "20", breaks = NULL, pal = "-viridis", text_size = 0.4, fps = 2, curve = TRUE, map_legend = TRUE, legend_title = "Casos por localidad", save = TRUE, name = "dengue_oaxaca_2026", dir = "./") ```
plot of chunk loc_oaxaca_fig
plot of chunk loc_serotypes_fig
plot of chunk mpo_oaxaca_fig