Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions R/theme_gtsummary_roche.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ theme_gtsummary_roche <- function(font_size = NULL,
"pkgwide-fn:pvalue_fun" = label_roche_pvalue(),
"add_overall.tbl_summary-arg:col_label" = "All Participants \n(N = {style_roche_number(N)})",
"pkgwide-str:print_engine" = print_engine,
"tbl_strata-fn:addnl-fn-to-run" =
\(x) {
crane::modify_header_rm_md(x, md = "bold", type = "star")
Comment on lines +56 to +58
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am thinking how to make it more general but this would fix tbl_strata if something like this is added to tbl_strata:

  # running any additional mods
  get_theme_element("tbl_hierarchical-fn:addnl-fn-to-run", default = identity) |>
    do.call(list(x))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you think @edelarua?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure Daniel would be open to modifying tbl_strata() for this. Is it possible to do all within crane?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's no introduce chagnes into gtsummary for this. I see two potential solutions.

  1. Abandon, and whenever we use this function in the catalog, we specify the .header argument to remove teh bold.
  2. We could also set pkgwide-fun:pre_conversion with a function that removes the markdown bold syntax from from spanning headers in x$table_styling. This would occur jsut before the gtsummary table is converted to flextable.

},
"tbl_hierarchical-fn:addnl-fn-to-run" =
\(x) {
gtsummary::remove_footnote_header(x) |>
Expand Down
Loading