Skip to content

Observed upper percentile line not drawn when lower percentile is censored (NA) - #125

Merged
roninsightrx merged 1 commit into
masterfrom
nightshift/122-observed-upper-percentile-line-not-drawn
Nov 12, 2026
Merged

roninsightrx merged 1 commit into
masterfrom
nightshift/122-observed-upper-percentile-line-not-drawn

Conversation

@roninsightrx

Copy link
Copy Markdown
Collaborator

Closes #122

geom_obs_ci_continuous() now draws observed lower/upper percentiles as two separate geom_line() layers (na.rm = TRUE) instead of a ribbon outline, so a censored NA in one percentile no longer hides the other. Added regression test, updated vdiffr snapshots, bumped to 1.3.4 with NEWS entry.


🤖 Implemented by Claude Code and reviewed by Codex, orchestrated by nightshift. Review rounds are posted as comments below.

… them (#122)

The observed lower and upper percentiles were drawn as the outline of a
single geom_ribbon(ymin = obs5, ymax = obs95). When one of them was NA
(censored by lloq/uloq) ggplot2 dropped the whole row, hiding the other,
valid percentile in that bin. Draw them as two geom_line() layers instead,
with na.rm = TRUE so interior NAs become gaps without a warning.

Updated vdiffr snapshots (same visuals, plus the upper line now extends
into the last bin of the lloq/log_y plot) and added a regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@roninsightrx roninsightrx left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Codex review, round 1: ✅ approved

The plotting change correctly separates the percentile lines and handles both LLOQ and ULOQ cases. The full suite passed (438 tests); only the test dependency-version mismatch remains.

Severity Location Finding
minor tests/testthat/test-vpc.R:88 The new test uses expect_no_warning(), introduced in testthat 3.1.5, while DESCRIPTION still declares testthat (>= 3.0.0). Running tests with the stated minimum will fail because the function is unavailable. Either raise the minimum testthat version or use an assertion supported by 3.0.0.

@roninsightrx
roninsightrx marked this pull request as ready for review November 12, 2026 21:09
@roninsightrx
roninsightrx merged commit 07c50c5 into master Nov 12, 2026
5 checks passed
@roninsightrx
roninsightrx deleted the nightshift/122-observed-upper-percentile-line-not-drawn branch November 12, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observed upper percentile line not drawn when lower percentile is censored (NA)

1 participant