pharmaverse / ggsurvfit

http://www.danieldsjoberg.com/ggsurvfit/
Other
67 stars 19 forks source link

Honoring `start.time` specifications #197

Closed ddsjoberg closed 2 months ago

ddsjoberg commented 2 months ago

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)

When the branch is ready to be merged into master:

ddsjoberg commented 2 months ago

Thank you for reviewing @bailliem ! Much appreciated!