我正在使用gtsummary包来构建一个患者特征表。我在使用选择功能all_dichotomous时遇到了问题。一些变量默认显示在一行上,但我希望它们都显示在多行上。
这是我正在使用的代码,但我得到了一个错误。有什么建议吗?谢谢!此数据集在包中。
library(gtsummary)
trial %>%
tbl_summary(type = list(all_dichotomous = "categorical"))发布于 2020-04-12 23:20:04
你就快成功了!您将希望在列表中使用公式表示法,而不是命名列表。如下所示:
library(gtsummary)
trial %>%
dplyr::select(response, age) %>%
tbl_summary(type = list(all_dichotomous() ~ "categorical"))

这里有一些示例:http://www.danieldsjoberg.com/gtsummary/articles/tbl_summary.html#select_helpers
https://stackoverflow.com/questions/61173570
复制相似问题