Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honoring start.time specifications #197

Merged
merged 7 commits into from
Apr 25, 2024
Merged

Honoring start.time specifications #197

merged 7 commits into from
Apr 25, 2024

Conversation

ddsjoberg
Copy link
Collaborator

@ddsjoberg ddsjoberg commented Apr 4, 2024

What changes are proposed in this pull request?

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

Thank you @bethatkinson for the guidance on this update.

We now respect the start.time specification, and print a note about specifying start.time when there are negative times.

library(ggsurvfit)
#> Loading required package: ggplot2

survfit2(Surv(time, status) ~ sex, df_lung, start.time = 10) |>
  ggsurvfit() +
  add_risktable()

survfit2(Surv(time - 10, status) ~ sex, df_lung) |>
  ggsurvfit()
#> ! Setting start time to -9.83572895277207.
#> ℹ Specify `ggsurvfit::survfit2(start.time)` to override this default.

Created on 2024-04-04 with reprex v2.1.0


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
Collaborator

@bailliem bailliem left a comment

Choose a reason for hiding this comment

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

All looks good based on the issue and ready to go.

@ddsjoberg
Copy link
Collaborator Author

Thank you for reviewing @bailliem ! Much appreciated!

@ddsjoberg ddsjoberg merged commit b2defc6 into main Apr 25, 2024
11 checks passed
@ddsjoberg ddsjoberg deleted the 192-start.time branch April 25, 2024 15:15
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.

include survfit(...)$start.time information when plotting
2 participants