From 12765cdb8180f4f2b313f57a06a271390dce13c4 Mon Sep 17 00:00:00 2001 From: Zachary Susswein Date: Fri, 11 Oct 2024 15:19:55 +0000 Subject: [PATCH] No margin for error --- R/fit_model.R | 2 +- tests/testthat/_snaps/fit_model.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/fit_model.R b/R/fit_model.R index 1d570d1c..aac36b5b 100644 --- a/R/fit_model.R +++ b/R/fit_model.R @@ -160,7 +160,7 @@ format_right_truncation <- function(pmf, data) { # silently removed if length of the PMF was longer than the data, # effectively eliminating the right-truncation correction - trunc_len <- nrow(data) - 1 + trunc_len <- nrow(data) cli::cli_warn( c( "Removing right-truncation PMF elements after {.val {trunc_len}}", diff --git a/tests/testthat/_snaps/fit_model.md b/tests/testthat/_snaps/fit_model.md index e5d431ba..a24cde65 100644 --- a/tests/testthat/_snaps/fit_model.md +++ b/tests/testthat/_snaps/fit_model.md @@ -1,6 +1,6 @@ # Right truncation longer than data throws error - Removing right-truncation PMF elements after 1 + Removing right-truncation PMF elements after 2 Right truncation PMF longer than the data PMF length: 3 Data length: 2