如何删除 gtsummary 表中的特定脚注。例如,我想删除脚注2 Wilcoxon rank sum test; Pearson's Chi-squared test但保留另一个。
library(gtsummary)
library(dplyr)
trial[c("age", "grade", "trt")] %>%
tbl_summary(by = trt, missing = "no") %>%
add_p()
Run Code Online (Sandbox Code Playgroud)
您将需要使用该modify_footnote()函数来删除脚注。下面举例!
library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.5.0'
tbl <-
trial[c("age", "grade", "trt")] %>%
tbl_summary(by = trt, missing = "no") %>%
add_p() %>%
# remove footnotes
modify_footnote(c(all_stat_cols(), p.value) ~ NA)
Run Code Online (Sandbox Code Playgroud)
由reprex 包于 2021 年 11 月 19 日创建(v2.0.1)