--- title: "Graphs of dengue cases" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Graphs of dengue cases} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- [Versión en español](graficos.html) ## Introduction **densnv** has four functions to plot the dengue cases of the SINAVE dataset: |function |graph |output | |:--------------|:--------------------------------------------------------------------------|:----------------| |plt_pyramid() |Pyramid of confirmed cases by age group and sex |ggplot | |plt_serotype() |Confirmed cases by state or municipality and diagnosis, with the serotypes |ggplot (cowplot) | |plt_treemap() |Treemap of cases by state or municipality and final diagnosis |ggplot | |plt_heatmap() |Interactive heatmap (plotly) of cases by municipality and week |plotly | Titles and labels are in Spanish, the language of the users of the Mexican vector-borne disease program. ``` r library(densnv) ``` ## Data ``` r x <- data.table::fread("DENGUE2_.txt", quote = "", fill = TRUE) ``` ``` r year <- max(x$ANO, na.rm = TRUE) year #> [1] 2026 ``` ## Pyramid by age and sex `plt_pyramid()` uses the confirmed cases (`ESTATUS_CASO == 2`) in 15 age groups, with males on the left and females on the right. Each side is headed by a Font Awesome icon and the total cases by sex, which act as the legend. For a state or municipality, filter the dataset first: ``` r oax <- x[x$CVE_EDO_REP == 20 & x$ANO == year, ] plt_pyramid(data = oax, col_male = "#0072B2", col_female = "#CC79A7", gap = 0.18, size_age = 3.5, size_count = 3, icon_male = "person", icon_female = "person-dress", show_zero = FALSE, title = "Casos confirmados de dengue por grupo de edad y sexo", subtitle = paste0("Oaxaca, ", year), caption = "Fuente: SINAVE/DGE, Secretaría de Salud.") ```
plot of chunk pyramid
plot of chunk serotype_country
plot of chunk serotype_oaxaca
plot of chunk treemap_country
plot of chunk treemap_oaxaca
plot of chunk heatmap_fig