insightsengineering / insightsengineering/crane

Add a header label for when we display a table with no value assigned to a "by" variable in theme_gtsummary_roche()?

Open
#81 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
15
Forks
7
Avg merge
6d 9h
Merged PRs (30d)
5

Description

Can we add a default header label for `theme_gtsummary_roche` if we use `NULL` or assign no value to a by variable ? For example "All Participants" should be displayed as a default, as shown in the example. Currently this setting only works with the theme when you do `add_overall`

```
library(crane)
#> Loading required package: gtsummary

tbl <-
cards::ADAE[c(1, 2), ] |>
tbl_hierarchical_rate_and_count(
variables = c(AEBODSYS, AEDECOD),
denominator = cards::ADSL
)

# Set header label
tbl |>
modify_header(stat_0 ~ "All Participants \nN = {n}") |>
as_kable()
```

| Body System or Organ Class     Dictionary-Derived Term | All Participants N = 254 |
|:---|:--:|
| Total number of participants with at least one adverse event | 1 (0.4%) |
| Overall total number of events | 2 |
| GENERAL DISORDERS AND ADMINISTRATION SITE CONDITIONS | |
| Total number of participants with at least one adverse event | 1 (0.4%) |
| Total number of events | 2 |
| APPLICATION SITE ERYTHEMA | 1 (0.4%) |
| APPLICATION SITE PRURITUS | 1 (0.4%) |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.