Fix base conditional power plot labels for r-devel text() truncation#231
Merged
Fix base conditional power plot labels for r-devel text() truncation#231
text() truncation#231Conversation
Contributor
There was a problem hiding this comment.
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
plotgsCPto match the number of plotted points by usinglength(y2$Ztxt)instead ofx$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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #228
This PR aligns the
text()label count with plotted points inplotgsCPto avoid r-devel (R 4.6.0) truncation warnings and redundant SVG nodes in vdiffr snapshots whenplottype = 4,base = TRUE.