Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
549 views
in Technique[技术] by (71.8m points)

summary - R gtsummary Overall Column Moved After Merge

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: t1

Once the merge occurs, the overall column has moved: tbl_merge

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...