# Aggregate by year dat_month <- dat_month[, .(measles_clinical =sum(measles_clinical)), by = .(year, iso3)]
Visualization
Code
# Get griddata("world_countries_grid1", package ="geofacet")# Fontssyf$font_add_google("Fascinate Inline", "Fascinate Inline")sht$showtext_auto()sht$showtext_opts(dpi =600)title_font <-"Fascinate Inline"# Measles colorscolors <-c('#F4A6A6', # light coral, reflecting the lighter areas of the rash'#E25822', # a strong red-orange, often used for rashes or spots'#B22222'# a deep firebrick, suitable for the darker spots or advanced rash stages )# Tagtag <-"<span style='color:#B22222;font-size:22pt;'>Clinically-compatible measles cases</span><br><br> <span style='color:#E25822;font-size:14pt;'>A suspected case with fever, maculopapular rash, and at least one of cough, coryza, or conjunctivitis, without a clinical specimen or epidemiological link to a confirmed case.</span>"# Plotg <- gg$ggplot(dat_month) + gg$aes(x = year, y = measles_clinical, color = measles_clinical, size = measles_clinical) + gg$geom_point() + gg$scale_size_continuous(range =c(0.3, 4.5)) + gg$scale_color_gradientn(colors = colors) + ggf$facet_geo(~iso3, grid ='world_countries_grid1') + gg$theme_void() + gg$labs(tag = tag) + gg$theme(plot.background = gg$element_rect(fill ='white'),strip.background = gg$element_blank(),strip.text.x = gg$element_blank(),legend.position ='none',plot.tag.position =c(0.05, 0.15),plot.tag = ggt$element_textbox_simple(family = title_font,width = gg$unit(4.5, "inch"),lineheight =1.2,hjust =0 ) ) # Create the main visualizationgg$ggsave('week_25.png', g, height =10, width =16, dpi =600)