From c25de3465968b4d344a2313c5dda9e38500b1328 Mon Sep 17 00:00:00 2001 From: Sebastian Funk Date: Tue, 20 Feb 2024 10:56:09 +0000 Subject: [PATCH] only extract `frac_obs` if `obs_scale_sd` exists --- R/extract.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/extract.R b/R/extract.R index 2c8965f92..ae2e18e0f 100644 --- a/R/extract.R +++ b/R/extract.R @@ -246,7 +246,7 @@ extract_parameter_samples <- function(stan_fit, data, reported_dates, value.V1 := NULL ] } - if (data$obs_scale_sd > 0) { + if ("obs_scale_sd" %in% names(data) && data$obs_scale_sd > 0) { out$fraction_observed <- extract_static_parameter("frac_obs", samples) out$fraction_observed <- out$fraction_observed[, value := value.V1][, value.V1 := NULL