From 7da75a2944953faf9c012407516205a97a12ef5b Mon Sep 17 00:00:00 2001 From: James Hay <9113187+jameshay218@users.noreply.github.com> Date: Thu, 15 Aug 2024 17:53:20 +0100 Subject: [PATCH] Corrected population_group in attack rate plot when by_group=FALSE --- R/plot_infection_histories.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/plot_infection_histories.R b/R/plot_infection_histories.R index 0b1767d..0a5969a 100644 --- a/R/plot_infection_histories.R +++ b/R/plot_infection_histories.R @@ -264,6 +264,7 @@ plot_attack_rates_pointrange <- function(infection_histories, if (!by_group) { antibody_data$population_group <- 1 infection_histories$population_group <- 1 + demographics$population_group <- 1 if(!is.null(true_ar)) true_ar$population_group <- 1 } @@ -339,6 +340,7 @@ plot_attack_rates_pointrange <- function(infection_histories, year_breaks <- c(year_breaks, max_time + 2) year_labels <- c(year_labels, "Prior") } + if (!plot_den) { quantiles <- ddply(tmp, .(j, population_group), function(x) quantile(x$V1, c(0.025, 0.5, 0.975))) colnames(quantiles) <- c("j", "population_group", "lower", "median", "upper")