From ee61cba2612e085732fa2bf280e416f52222b3c5 Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Tue, 13 Jan 2026 16:56:18 -0500 Subject: [PATCH 1/2] Ensure Chromy gets total sample size instead of rounding down in rare cases --- R/chromy_pps.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/chromy_pps.R b/R/chromy_pps.R index 0234c7d..a21c7ab 100644 --- a/R/chromy_pps.R +++ b/R/chromy_pps.R @@ -112,6 +112,7 @@ chromy_inner <- function(exphits) { # Set-up vectors of I, F, lower bound of hits, and a uniform random number exphitscum <- cumsum(exphits) + exphitscum[N] <- ceiling(sum(exphits)) I <- floor(exphitscum) F <- exphitscum - I hits <- rep(0, N) From 8764e362eec7fc82fc21a43565de172a05abece5 Mon Sep 17 00:00:00 2001 From: Stephanie Zimmer Date: Tue, 13 Jan 2026 17:08:42 -0500 Subject: [PATCH 2/2] Round instead of ceiling --- R/chromy_pps.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/chromy_pps.R b/R/chromy_pps.R index a21c7ab..0692e76 100644 --- a/R/chromy_pps.R +++ b/R/chromy_pps.R @@ -112,7 +112,7 @@ chromy_inner <- function(exphits) { # Set-up vectors of I, F, lower bound of hits, and a uniform random number exphitscum <- cumsum(exphits) - exphitscum[N] <- ceiling(sum(exphits)) + exphitscum[N] <- round(sum(exphits)) I <- floor(exphitscum) F <- exphitscum - I hits <- rep(0, N)