From: Naeem Model Date: Thu, 29 May 2025 16:44:05 +0000 (+0000) Subject: Refactor seqB X-Git-Url: https://git.nmode.ca/Rnaught/commitdiff_plain/31045413d167ed653f44f40ecfb1163038f9b2d3 Refactor seqB --- diff --git a/R/seq_bayes.R b/R/seq_bayes.R index ccc9a41..b25d273 100644 --- a/R/seq_bayes.R +++ b/R/seq_bayes.R @@ -103,17 +103,13 @@ seq_bayes <- function(cases, mu, kappa = 20, post = FALSE) { ) } - if (any(cases == 0)) { - times <- which(cases > 0) - if (length(times) < 2) { - stop("Case counts must contain at least two positive integers.", - call. = FALSE - ) - } - cases <- cases[times] - } else { - times <- seq_along(cases) + times <- which(cases > 0) + if (length(times) < 2) { + stop("Case counts must contain at least two positive integers.", + call. = FALSE + ) } + cases <- cases[times] support <- seq(0, kappa, 0.01) tau <- diff(times)