Skip to content

Fix base conditional power plot labels for r-devel text() truncation#231

Merged
nanxstats merged 3 commits intomasterfrom
truncate-label
Dec 6, 2025
Merged

Fix base conditional power plot labels for r-devel text() truncation#231
nanxstats merged 3 commits intomasterfrom
truncate-label

Conversation

@nanxstats
Copy link
Collaborator

Fixes #228

This PR aligns the text() label count with plotted points in plotgsCP to avoid r-devel (R 4.6.0) truncation warnings and redundant SVG nodes in vdiffr snapshots when plottype = 4, base = TRUE.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the plotgsCP function where base plotting for conditional power (plottype = 4) was creating more labels than plotted points, causing truncation warnings in r-devel (R 4.6.0) and redundant SVG nodes in vdiffr snapshots.

Key changes:

  • Fixed label count in plotgsCP to match the number of plotted points by using length(y2$Ztxt) instead of x$k
  • Updated vdiffr snapshots to reflect the removal of duplicate text elements
  • Documented the fix in NEWS.md for version 3.8.0

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
R/gsqplot.R Fixed base plotting labels in plotgsCP to use length(y2$Ztxt) (equals x$k - 1) instead of x$k, matching the actual number of interim analysis points
tests/testthat/_snaps/independent-test-plot.gsProbability/plottype-4-base-true.svg Removed duplicate N=20 label that was being truncated by r-devel
tests/testthat/_snaps/independent-test-plot.gsDesign/plottype-4-base-true.svg Removed duplicate N=20 label that was being truncated by r-devel
NEWS.md Documented the bug fix for version 3.8.0 release

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nanxstats nanxstats merged commit 6dcb49b into master Dec 6, 2025
13 of 14 checks passed
@nanxstats
Copy link
Collaborator Author

r-devel still fails but for an unrelated reason (Rcpp can't build due to r-devel change that has been reverted): RcppCore/Rcpp#1418 so I'm going to merge this.

@nanxstats nanxstats deleted the truncate-label branch December 6, 2025 04:21
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.

vdiffr snapshot testing error from text() truncating labels under r-devel (4.6.0)

1 participant

Comments