In the past, when I've created a summary table with an overall column and merged it, the column remains on the left. However, recently, after merging and modifying the spanning header, the overall column is not on the left.
Here is an example:
library(gtsummary)
t1 <- trial %>% select(trt, age) %>%
tbl_summary(
by = trt) %>%
add_overall(col_label = "**Overall**") %>%
modify_header(stat_by = "**{level}**")
t2 <- trial %>% select(grade, age) %>%
tbl_summary(
by = grade) %>%
modify_header(stat_by = "**{level}**")
tbl_merge(
tbls = list(t1, t2),
tab_spanner = c("**Treatment**", "**Tumor Grade**")
) %>%
modify_spanning_header(stat_0_1 ~ NA) %>%
modify_footnote(everything() ~ NA)
Looking at the first table prior to merging (t1), the overall column is on the left:
Once the merge occurs, the overall column has moved:
I was using the same code as was suggested in a previous post. Has something changed with the recent package update, is there something in my code that may be the culprit, or is there a workaround to get the overall column on the left?
Thanks,
Ben
question from:
https://stackoverflow.com/questions/65882941/r-gtsummary-overall-column-moved-after-merge 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…