Skip to content

Closes #271 surv_cnsr: allow CSNR > 1#272

Merged
ddsjoberg merged 2 commits intopharmaverse:mainfrom
bundfussr:271_surv_cnsr
Mar 2, 2026
Merged

Closes #271 surv_cnsr: allow CSNR > 1#272
ddsjoberg merged 2 commits intopharmaverse:mainfrom
bundfussr:271_surv_cnsr

Conversation

@bundfussr
Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Allow CNSR > 1 in Surv_CNSR() to be in line with CDISC recommendation.

If there is an GitHub issue associated with this pull request, please provide link.

#271


Reviewer Checklist (if item does not apply, mark as complete)

  • Ensure all package dependencies are installed by running renv::install()
  • PR branch has pulled the most recent updates from master branch. Ensure the pull request branch and your local version match and both have the latest updates from the master branch.
  • If a new function was added, function included in _pkgdown.yml
  • If a bug was fixed, a unit test was added for the bug check
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Overall code coverage remains >99.5%. Review coverage with withr::with_envvar(list(CI = TRUE), code = devtools::test_coverage()). Begin in a fresh R session without any packages loaded.
  • R CMD Check runs without errors, warnings, and notes
  • usethis::use_spell_check() runs with no spelling errors in documentation

When the branch is ready to be merged into master:

  • Update NEWS.md with the changes from this pull request under the heading "# ggsurvfit (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • Increment the version number using usethis::use_version(which = "dev")
  • Run usethis::use_spell_check() again
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge".

Copy link
Copy Markdown
Collaborator

@ddsjoberg ddsjoberg left a comment

Choose a reason for hiding this comment

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

Looks great, thank you. Let's update one small data check, bump the version number, and merge.

R/Surv_CNSR.R Outdated
Comment on lines +71 to +72
if (any(stats::na.omit(CNSR) < 0)) {
stop("Expecting 'CNSR' argument to be non-negative (>=0).")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (any(stats::na.omit(CNSR) < 0)) {
stop("Expecting 'CNSR' argument to be non-negative (>=0).")
if (any(stats::na.omit(CNSR) < 0) || any(!rlang::is_integerish(CNSR))) {
stop("Expecting 'CNSR' argument to be non-negative integer (>=0).")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@@ -1,5 +1,8 @@
# ggsurvfit (development version)

* `Surv_CNSR()` updated to accept values `>= 1` as censoring values (according
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Feel free to add your @bundfussr if you'd like.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good idea, done

@ddsjoberg
Copy link
Copy Markdown
Collaborator

Thanks @bundfussr !

@ddsjoberg ddsjoberg merged commit 0d433c7 into pharmaverse:main Mar 2, 2026
9 of 10 checks passed
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.

2 participants