From 962df9efccc27d613b213cda2f0ff0d54d9ff51c Mon Sep 17 00:00:00 2001 From: ntorresd Date: Tue, 28 May 2024 09:47:11 -0500 Subject: [PATCH] fix: change to `extract_central_estimates` to deal with 1-time estimates --- R/plot_seromodel.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/plot_seromodel.R b/R/plot_seromodel.R index 51101cf3..7834cc36 100644 --- a/R/plot_seromodel.R +++ b/R/plot_seromodel.R @@ -107,7 +107,8 @@ extract_central_estimates <- function( alpha = 0.05, par_name = "foi_vector" ) { - samples <- rstan::extract(seromodel, par_name)[[1]] + samples <- rstan::extract(seromodel, par_name)[[1]] %>% + as.matrix() #to deal with 1-time estimates central_estimates <- data.frame( median = apply(samples, 2, quantile, 0.5), lower = apply(samples, 2, quantile, alpha),