# use files generated by sensitivity.R
filenames <- c("default_TRUE", "fitness_WM_1_TRUE", "fitness_MW_1_TRUE", "default_FALSE") %>%
paste0("~/overleaf/reassortment/sensitivity/results/", ., "/results.rds")
dir_out <- "~/overleaf/reassortment/paper_panels1/"
filenames_out <- letters[seq_along(filenames)] %>%
paste0(dir_out, "modelling_", ., ".pdf")
wrapper <- function(filename, filename_out) {
readRDS(filename) %>%
plot_multirun_strains %>%
ggsave(filename_out, ., width = 9, height = 7, units = "cm")
invisible(NULL)
}
Map(wrapper, filenames, filenames_out)
plot_legend <- function() {
strains <- c("PB1 K229R & PA P653L", "Wildtype", "PA P653L", "PB1 K229R")
dummy_df <- data.frame(strain = strains, x = seq_along(strains))
dummy_df$strain <- factor(dummy_df$strain, levels = strains)
colours <- c("purple", "black", "blue", "red")
names(colours) <- strains
g <- ggplot(dummy_df, aes(x = x,
y = x,
color = strain,
group = strain)) +
geom_line() +
scale_color_manual("", values = colours) +
theme_bw()
g
}
ggsave(paste0(dir_out, "legend.pdf"),
plot_legend())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.