Repository navigation
Conversation
…hr() When gs_update_ahr() adds an analysis beyond the original design (n_analysis greater than nrow(x$analysis)), a boundary supplied as a fixed numeric par vector was left at its original length. The commonest case is an efficacy-only design, whose lower bound is gs_b() with an -Inf par vector of length equal to the original number of analyses: gs_power_npe() then looked up par[k] for the new analysis, got NA, and failed in `if (a[k] > -Inf)` with "missing value where TRUE/FALSE needed". Pad fixed numeric par vectors (upper and lower) to the updated number of analyses, repeating the last value, before computing bounds. List-based spending pars already carry a `timing` of the right length and are untouched. Also use the padded lpar in the alpha-only branch for consistency (a no-op there, since that path keeps the original number of analyses). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch has not been deployed
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.
Problem
gs_update_ahr()can add an analysis beyond the original design (whenn_analysisexceedsnrow(x$analysis)). For a boundary supplied as a fixed numeric par vector, that vector was left at its original length, sogs_power_npe()looked uppar[k]for the new analysis and gotNA, failing inif (a[k] > -Inf)with:The common trigger is an efficacy-only design, whose lower bound is
gs_b()with an-Infpar vector sized to the original number of analyses.Fix
Pad fixed numeric par vectors (upper and lower) to the updated number of analyses, repeating the last value, before computing bounds. List-based spending pars already carry a
timingof the right length and are left untouched. The alpha-only branch now uses the paddedlparfor consistency (a no-op there, since that path keeps the original number of analyses).Found while fixing keaven/gsDesign2Shiny#104 / keaven/gsDesign2Shiny#105, where adding a 4th analysis in the Update tab silently dropped back to 3 analyses.
Test
Added a developer test: an efficacy-only design (
gs_bwith-Inffutility) gains a 4th analysis and reports a finite efficacy bound at every analysis.🤖 Generated with Claude Code