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   69 suites   1m 27s ⏱️
 69 tests  69 ✅ 0 💤 0 ❌
169 runs  169 ✅ 0 💤 0 ❌

Results for commit d5a79b7.

♻️ 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$
gkm 👶 $+0.03$ $+3$ $0$ $0$ $0$
modify_header_rm_md 💔 $0.11$ $+1.13$ $0$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
add_hierarchical_count_row 💔 $4.81$ $+1.13$ add_hierarchical_count_row_works
gkm 👶 $+0.03$ test_gkm_works
modify_header_rm_md 💔 $0.11$ $+1.13$ strip_md_bold_works_with_gtsummary_table

Results for commit b524fa0

♻️ 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_hierarchical_count_row.R            33       0  100.00%
R/crane-package.R                          2       2  0.00%    18-19
R/deprecated.R                             6       6  0.00%    15-21
R/gkm.R                                  330      54  83.64%   52, 107-124, 140, 204, 268, 291, 362-364, 368-375, 398-400, 407-410, 414, 425-429, 442, 444-446, 460, 463-467, 582-586
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                                   1700      68  96.00%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  -------
R/gkm.R        +330     +54  +83.64%
TOTAL          +330     +54  -2.98%

Results for commit: d5a79b7

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’

#' @param bg_fill Optional color string for the plot background.
#' @keywords internal
#' @return A \code{ggplot2} object representing the table.
#' @importFrom ggplot2 ggplot theme_void scale_x_continuous scale_y_continuous theme element_rect annotate element_text .pt
Copy link
Contributor

@Melkiades Melkiades Dec 1, 2025

Choose a reason for hiding this comment

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

we have the import. Is enought to add the @import for the package

#' @keywords internal
#' @import rlang
#' @import glue glue
#' @importFrom utils tail
Copy link
Contributor

Choose a reason for hiding this comment

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

I would import ggplot2 here

Comment on lines +1 to +20
f_conf_level <- function(conf_level) {
# assert_proportion_value(conf_level) # Assuming assert_proportion_value is defined elsewhere
paste0(conf_level * 100, "% CI")
}

control_surv_med_annot <- function(x = 0.8, y = 0.85, w = 0.32, h = 0.16, fill = TRUE) {
# assert_proportion_value(x)
# assert_proportion_value(y)
# assert_proportion_value(w)
# assert_proportion_value(h)

list(x = x, y = y, w = w, h = h, fill = fill)
}

control_coxph_annot <- function(x = 0.29, y = 0.51, w = 0.4, h = 0.125, fill = TRUE, ref_lbls = FALSE) {
checkmate::assert_logical(ref_lbls, any.missing = FALSE)

res <- c(control_surv_med_annot(x = x, y = y, w = w, h = h), list(ref_lbls = ref_lbls))
res
}
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe is best if all help functions are into an help file (utils_plot?)

Comment on lines +567 to +570
#' @importFrom broom tidy
#' @importFrom tidyr pivot_wider
#' @importFrom cowplot plot_grid
#' @importFrom ggplot2 labs theme_bw theme element_text element_blank element_line coord_cartesian scale_x_continuous scale_y_continuous
Copy link
Contributor

Choose a reason for hiding this comment

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

should we keep the imports here?

Missing examples

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