Skip to content

Use "All Participants" as overall label in tbl_hierarchical_rate_by_grade() - #337

Open
Melkiades wants to merge 1 commit into
mainfrom
333_overall_label@main
Open

Melkiades wants to merge 1 commit into
mainfrom
333_overall_label@main

Conversation

@Melkiades

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

add_overall.tbl_hierarchical_rate_by_grade() was a plain copy of gtsummary's add_overall.tbl_hierarchical(), so it kept the gtsummary default and showed "All Participants" only when theme_gtsummary_roche() was set. It is now a small wrapper with the crane default, like add_overall.tbl_hierarchical_rate_and_count(), and it keeps the statistic and digits arguments.

add_grade_column() restyled every stat column header with "{level} \n(N = {n})", and {level} of the overall column is "Overall", so any col_label was lost. It now leaves stat_0 alone when add_overall() was called. Unstratified tables (by = NULL) and tbl_with_pools() tables keep the headers they have today; a test locks the unstratified case.

The tests set theme_gtsummary_roche() for the whole suite (setup-theme.R), which is why the existing add_overall() test passed. The new test drops the theme for its duration.

The col_label docs of tbl_hierarchical_rate_and_count() now show its real default, "All Participants \n(N = {style_roche_number(N)})", instead of the gtsummary one they inherited (docs only, no NEWS entry).

Reference GitHub issue associated with pull request. closes #333


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".

add_overall() on tbl_hierarchical_rate_by_grade tables now defaults to
"All Participants  \n(N = {style_roche_number(N)})", as the other crane
add_overall() methods do, instead of the gtsummary default. Before, it
showed that label only under theme_gtsummary_roche().

add_grade_column() now keeps the overall column label set by
add_overall() instead of resetting it to "Overall". Unstratified tables
keep their current header.

The col_label docs of tbl_hierarchical_rate_and_count now show the real
default.
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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_forest_utils.R                        97      10  89.69%   76-79, 94-100
R/add_forest.R                             139       0  100.00%
R/add_hierarchical_count_row.R              33       0  100.00%
R/add_label_column.R                        26       0  100.00%
R/add_proportion_difference.R              150       1  99.33%   245
R/add_proportion_odds_ratio.R               57       0  100.00%
R/adjust_stat_columns_wrap.R                29       1  96.55%   59
R/annotate_gg_km.R                         141       0  100.00%
R/annotate_gg_pkc.R                        100       0  100.00%
R/annotate_gg.R                             94       0  100.00%
R/ard_tabulate_abnormal_by_baseline.R       65       0  100.00%
R/crane-package.R                            2       2  0.00%    26-27
R/deprecated.R                              21      21  0.00%    18-54
R/df_add_poolings.R                         41       0  100.00%
R/get_cox_pairwise_df.R                    163       0  100.00%
R/gg_km_utils.R                             39      14  64.10%   20-37
R/gg_km.R                                  143      37  74.13%   55-58, 75, 102, 176-181, 184-187, 197-199, 204-205, 239-241, 248-251, 255, 266-270, 283, 285-287
R/gg_lineplot.R                            113       0  100.00%
R/gg_mmrm_lineplot.R                       102       1  99.02%   106
R/gg_pkc_boxplot.R                         195       5  97.44%   108, 136-139
R/gg_pkc_lineplot.R                        118       0  100.00%
R/gg_utils.R                               222       0  100.00%
R/label_roche.R                             72       0  100.00%
R/modify_header_rm_md.R                     18       2  88.89%   35-36
R/modify_split_caption.R                    37       0  100.00%
R/modify_zero_recode.R                      20       1  95.00%   64
R/pk_helper.R                              499       0  100.00%
R/reverse_difference_ci.R                   33       0  100.00%
R/tbl_ada_summary.R                        200       4  98.00%   277-280
R/tbl_baseline_chg.R                       188       0  100.00%
R/tbl_coxph.R                               90       1  98.89%   229
R/tbl_hierarchical_incidence_rate.R        291       4  98.63%   430-433
R/tbl_hierarchical_rate_and_count.R        339      13  96.17%   346, 428, 449-459
R/tbl_hierarchical_rate_by_grade.R         322       3  99.07%   172-174
R/tbl_listing.R                             36       0  100.00%
R/tbl_mmrm.R                               344       6  98.26%   452-456, 548
R/tbl_null_report.R                         10       0  100.00%
R/tbl_proportion.R                         141      13  90.78%   100-103, 107-111, 114-117
R/tbl_rmpt.R                               157      12  92.36%   299-304, 316-321
R/tbl_roche_subgroups.R                    157       0  100.00%
R/tbl_roche_summary.R                       64       0  100.00%
R/tbl_shift.R                              111       0  100.00%
R/tbl_survfit_quantiles.R                  154       0  100.00%
R/tbl_survfit_times.R                       92       0  100.00%
R/tbl_with_pools.R                          79       1  98.73%   317
R/theme_gtsummary_roche.R                   87       1  98.85%   61
R/utils.R                                   42       0  100.00%
TOTAL                                     5837     153  97.38%

Diff against main

Filename                              Stmts    Miss  Cover
----------------------------------  -------  ------  -------
R/tbl_hierarchical_rate_by_grade.R       +5       0  +0.01%
TOTAL                                    +5       0  +0.00%

Results for commit: da0af4c

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Unit Tests Summary

    1 files    353 suites   2m 14s ⏱️
  353 tests   353 ✅ 0 💤 0 ❌
1 018 runs  1 018 ✅ 0 💤 0 ❌

Results for commit da0af4c.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Performance Difference

Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
add_forest 💚 $3.55$ $-2.51$ add_forest_table_engine_flextable_works
add_grade_column 👶 $+0.00$ add_grade_column_keeps_the_add_overall_column_label_333_
add_grade_column 💔 $6.72$ $+3.90$ add_grade_column_works_on_a_standalone_tbl_hierarchical_rate_by_grade
annotate_gg 💔 $0.09$ $+3.04$ annotate_lineplot_df_warns_if_plot_is_not_generated_by_gg_lineplot
annotate_gg_pkc 💔 $0.13$ $+1.23$ annotate_pkc_df_warns_when_given_a_standard_ggplot_object
gg_km 💚 $2.84$ $-2.45$ gg_km_works_and_handles_annotations_correctly
tbl_baseline_chg 💔 $13.17$ $+1.72$ tbl_baseline_chg_works
tbl_hierarchical_incidence_rate 💔 $17.53$ $+2.73$ tbl_hierarchical_incidence_rate_runs_with_minimum_arguments
tbl_hierarchical_rate_and_count 💔 $8.58$ $+1.22$ tbl_hierarchical_rate_and_count_works
tbl_hierarchical_rate_by_grade 👶 $+0.00$ tbl_hierarchical_rate_by_grade_add_overall_label_does_not_need_the_Roche_theme_333_
tbl_hierarchical_rate_by_grade 💔 $0.81$ $+1.35$ tbl_hierarchical_rate_by_grade_works
tbl_rmpt 💔 $2.43$ $+1.23$ tbl_rmpt_works_with_default_parameters_Example_1_
tbl_roche_subgroups 💔 $0.25$ $+9.14$ tbl_roche_subgroups_time_to_event_NULL_works
tbl_shift 💚 $8.52$ $-8.14$ tbl_shift_strata_location_

Results for commit 769a1cc

♻️ This comment has been updated with latest results.

This branch has not been deployed

No deployments
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.

Not updated Overall label default value to All Participants as for other functions for tbl_hierarchical_rate_by_grade()

1 participant