
Generate incidence map timeline
generate_incidence_map.RdGenerates an incidence map and an epicurve showing positive detections for emergence groups.
Usage
generate_incidence_map(
pos_data,
ctry_sf,
emergence_group = NULL,
emergence_colors = NULL,
sources = c("AFP", "ENV"),
start_date = NULL,
end_date = NULL,
monthly_rolling_window = 12,
output_dir = NULL,
fps = 2,
drop_legend = FALSE,
drop_ctry_labels = FALSE,
drop_description = FALSE,
pt_size = 0.7
)Arguments
- pos_data
tibblePositives dataset.- ctry_sf
ctry_sfGlobal country shapefile.- emergence_group
strAn emergence group or a vector of emergence group names.- emergence_colors
listA named list where each emergence group is mapped its own color. Names correspond to the emergence group, while values are the colors. If no colors are passed, then colors are randomly selected for each emergence group.- sources
strSource of detection or a vector of source names. Valid values are: "AFP", "Community", "Contact", "ENV", "Healthy", "iVDPV".- start_date
strStart date of the map. By default, it will be the earliest date of detection.- end_date
strEnd date of the map. By default, it will be the latest detection.- monthly_rolling_window
intMonthly rolling window to show. Defaults to 12.- output_dir
strLocal path to the directory to output the figure. Defaults to NULL, which does not export the figure.- fps
intFrames per second. To increase the speed of the GIF, increase the fps. By default, it is set to 2.- drop_legend
logicalDrop legends of the figure or not.- drop_ctry_labels
logicalDrop country labels for the map.- drop_description
logicalDrop the case counts of the map caption.- pt_size
intSize of the points in the map. Defaults to 5.
Examples
if (FALSE) { # \dontrun{
raw_data <- get_all_polio_data
generate_incidence_map(raw_data$pos,
raw_data$global.ctry,
emergence_group = c("YEM-TAI-1", "SOM-BAN-1", "ETH-TIG-1"))
} # }