Plot density plots of the basic reproduction number

plot_R0_density(sims = NULL)

Arguments

sims

A data.table from scenario_analysis.

Value

A ggplot2 plot of R0 density over the scenarios explored

Examples

## Code plot_R0_density
#> function (sims = NULL) #> { #> scenario <- NULL #> time <- NULL #> event_size <- NULL #> x <- NULL #> R0 <- NULL #> serial_type <- NULL #> plot <- sims %>% dplyr::group_by(scenario, sample) %>% dplyr::filter(time == #> max(time)) %>% dplyr::ungroup() %>% dplyr::mutate(serial_type = serial_type %>% #> stringr::str_replace_all("initial SARS-like", "pre-intervention SARS-like") %>% #> factor(levels = c("MERS-like", "SARS-like", "pre-intervention SARS-like"))) %>% #> ggplot2::ggplot(ggplot2::aes(x = R0, y = factor(event_size), #> fill = stat(x))) + ggridges::geom_density_ridges_gradient(quantile_lines = TRUE, #> quantiles = c(0.05, 0.95)) + ggplot2::facet_grid(serial_type ~ #> event_duration) + ggplot2::scale_fill_continuous(type = "viridis", #> direction = 1) + ggplot2::theme_minimal() + ggplot2::labs(x = "Reproduction number (R0)", #> y = "Transmission event size") + ggplot2::theme(legend.position = "bottom") + #> ggplot2::guides(fill = ggplot2::guide_colorbar(title = "R0")) #> return(suppressWarnings(suppressMessages(plot))) #> } #> <bytecode: 0x55a6b3fe4420> #> <environment: namespace:WuhanSeedingVsTransmission>