Plot a heat map of accepted samples by scenario

plot_per_accepted_tile(proportion_allowed = NULL)

Arguments

proportion_allowed

data.frame of allowed proportions as produced by proportion_allowed_by_condition by condition_and_report_on_cases.

Value

A ggplot2 heat-map of accepted percentages by scenario

Examples

## Code plot_per_accepted_tile
#> function (proportion_allowed = NULL) #> { #> event_duration <- NULL #> event_size <- NULL #> serial_mean <- NULL #> upper_R0 <- NULL #> allowed_per <- NULL #> lower_R0 <- NULL #> joined_R0 <- NULL #> serial_type <- NULL #> proportion_allowed %>% dplyr::mutate(joined_R0 = paste0(lower_R0, #> " - ", upper_R0), 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"))) %>% tidyr::complete(event_duration, #> event_size, serial_type, joined_R0, fill = list(allowed_per = 0)) %>% #> dplyr::mutate_at(.vars = c("event_duration", "event_size"), #> factor) %>% ggplot2::ggplot(ggplot2::aes(x = event_duration, #> y = event_size, fill = allowed_per)) + ggplot2::geom_tile(alpha = 0.95) + #> ggplot2::scale_fill_continuous(label = scales::percent_format(accuracy = 1L), #> type = "viridis", direction = 1) + ggplot2::facet_grid(serial_type ~ #> joined_R0) + ggplot2::theme_minimal() + ggplot2::theme(legend.position = "bottom") + #> ggplot2::guides(fill = ggplot2::guide_colorbar(title = "Percentage of samples accepted")) + #> ggplot2::labs(x = "Transmission event duration", y = "Transmission event size") #> } #> <bytecode: 0x55a6b54dbc18> #> <environment: namespace:WuhanSeedingVsTransmission>