Skip to content

Conversation

@shajoezhu
Copy link
Contributor

What changes are proposed in this pull request?

  • Style this entry in a way that can be copied directly into NEWS.md. (#, @)

Provide more detail here as needed.

Reference GitHub issue associated with pull request. e.g., 'closes #'


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()
  • Request a reviewer

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

  • If a bug was fixed, a unit test was added.
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Code coverage is suitable for any new functions/features: devtools::test_coverage()

When the branch is ready to be merged:

  • Update NEWS.md with the changes from this pull request under the heading "# cards (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).
  • All GitHub Action workflows pass with a ✅
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge" or "Rebase and merge".

@shajoezhu
Copy link
Contributor Author

shajoezhu commented Nov 28, 2025

try and use exisitng structure and surv functions, refactoring will be addressed in #142

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Unit Tests Summary

  1 files   71 suites   1m 30s ⏱️
 71 tests  71 ✅ 0 💤 0 ❌
179 runs  179 ✅ 0 💤 0 ❌

Results for commit 1c66e79.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
gg_km 👶 $+0.17$ $+3$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
gg_km 👶 $+0.17$ gg_km_works_with_default_inputs
tbl_shift 💚 $20.42$ $-1.16$ tbl_shift_strata_location_

Results for commit 75185b2

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

badge

Code Coverage Summary

Filename                               Stmts    Miss  Cover    Missing
-----------------------------------  -------  ------  -------  ------------------------------------------------------------------------------------------------
R/add_blank_rows.R                        63       0  100.00%
R/add_difference_row.R                   101       0  100.00%
R/add_hierarchical_count_row.R            33       0  100.00%
R/annotate_gg_km.R                       137       9  93.43%   86-89, 108-112
R/crane-package.R                          2       2  0.00%    25-26
R/deprecated.R                             6       6  0.00%    15-21
R/get_cox_pairwise_df.R                   45      13  71.11%   68-71, 74-77, 82, 92-95
R/gg_km_utils.R                          100      17  83.00%   31, 87, 113-130, 146
R/gg_km.R                                142      37  73.94%   54-57, 74, 101, 178-183, 186-189, 198-200, 205-206, 240-242, 249-252, 256, 267-271, 284, 286-288
R/label_roche.R                           72       0  100.00%
R/modify_header_rm_md.R                   18       2  88.89%   35-36
R/modify_zero_recode.R                    13       0  100.00%
R/tbl_baseline_chg.R                     186       0  100.00%
R/tbl_hierarchical_rate_and_count.R      148       0  100.00%
R/tbl_hierarchical_rate_by_grade.R       271       3  98.89%   162-164
R/tbl_listing.R                           35       0  100.00%
R/tbl_null_report.R                        9       0  100.00%
R/tbl_roche_summary.R                     64       0  100.00%
R/tbl_shift.R                            116       0  100.00%
R/tbl_survfit_quantiles.R                132       1  99.24%   295
R/tbl_survfit_times.R                     92       0  100.00%
R/theme_gtsummary_roche.R                 74       0  100.00%
R/utils.R                                 36       0  100.00%
TOTAL                                   1895      90  95.25%

Diff against main

Filename                   Stmts    Miss  Cover
-----------------------  -------  ------  -------
R/annotate_gg_km.R          +137      +9  +93.43%
R/get_cox_pairwise_df.R      +45     +13  +71.11%
R/gg_km_utils.R             +100     +17  +83.00%
R/gg_km.R                   +142     +37  +73.94%
TOTAL                       +424     +76  -3.80%

Results for commit: 1c66e79

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@shajoezhu
Copy link
Contributor Author

need examples and export
h_km_fit, h_tbl_coxph_pairwise,

@shajoezhu shajoezhu mentioned this pull request Nov 30, 2025
3 tasks
@shajoezhu
Copy link
Contributor Author

my styler is failing, @edelarua , i was wondering how you guys check style here https://github.com/insightsengineering/crane/actions/runs/19792793759/job/56708402248?pr=141

@shajoezhu
Copy link
Contributor Author

  • checking Rd cross-references ... WARNING
    Missing link(s) in Rd file 'annot_cox_ph.Rd':
    ‘control_coxph_annot’

Missing link(s) in Rd file 'annot_surv_med.Rd':
‘control_surv_med_annot’

Missing link(s) in Rd file 'h_tbl_coxph_pairwise.Rd':
‘control_coxph’

Missing link(s) in Rd file 's_coxph_pairwise.Rd':
‘control_coxph’

See section 'Cross-references' in the 'Writing R Extensions' manual.

  • checking for missing documentation entries ... WARNING
    Undocumented code objects:
    ‘obj_label’
    Undocumented S4 methods:
    generic 'obj_label' and siglist 'ANY'
    generic 'obj_label<-' and siglist 'ANY'
    All user-level objects in a package (including S4 classes and methods)
    should have documentation entries.
    See chapter ‘Writing R documentation files’ in the ‘Writing R
    Extensions’ manual.
  • checking for code/documentation mismatches ... OK
  • checking Rd \usage sections ... WARNING
    Undocumented arguments in Rd file 'obj_label-set.Rd'
    ‘obj’

@shajoezhu
Copy link
Contributor Author

hi davide, can you fix the test please https://github.com/insightsengineering/crane/actions/runs/19936180249/job/57161536238 thanks

@Melkiades Melkiades marked this pull request as ready for review December 8, 2025 16:33
Copy link
Contributor

@Melkiades Melkiades left a comment

Choose a reason for hiding this comment

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

There is an issue with alignment that I still need to work on. It was already an issue in the first version of the template ;)

@shajoezhu
Copy link
Contributor Author

There is an issue with alignment that I still need to work on. It was already an issue in the first version of the template ;)

for the risk table? I think that is minor, we can either create an issue to fix this, or move to ggsurft in the refacorting

@shajoezhu shajoezhu requested a review from Melkiades December 10, 2025 03:47
@shajoezhu
Copy link
Contributor Author

hi @Melkiades , thanks for the changes, i think it looks great!

Copy link
Contributor

@Melkiades Melkiades left a comment

Choose a reason for hiding this comment

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

I think it is good to go. There are other updates to be done but minor changes

gg_coxph <- suppressMessages(
gg_coxph +
ggplot2::scale_x_continuous(expand = c(0.025, 0)) +
ggplot2::scale_y_continuous(labels = rev(rownames(coxph_tbl)), breaks = seq_len(nrow(coxph_tbl)))
Copy link
Contributor

Choose a reason for hiding this comment

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

This may benefit a refactoring as happened for annotate_risk

@Melkiades
Copy link
Contributor

@shajoezhu we could use add_* instead of annotate_*? might be clearer

@shajoezhu
Copy link
Contributor Author

@shajoezhu we could use add_* instead of annotate_*? might be clearer

honestly, i have no strong opinion on this

@Melkiades
Copy link
Contributor

@shajoezhu we could use add_* instead of annotate_*? might be clearer

honestly, i have no strong opinion on this

probably not because it would create confusion with ggsurvfit (add_risktable function for example)

@Melkiades
Copy link
Contributor

I think it is good to go @shajoezhu

@shajoezhu
Copy link
Contributor Author

hi @Melkiades , can you fix the cicd thanks!

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.

3 participants