有没有办法更改 gtsummary 包表中的字体?具体就是改成Times New Roman字体

Is there a way to change the font in tables of gtsummary package? Specifically, change it into Times New Roman font

我正在为我的硕士论文制作带有描述性的表格,而 gtsummary 给出了最好的输出。但是,该字体不同于我想在写作中使用的字体(Times New Roman)和其他采用 APA 样式的 word 表格 - 表格。我想从 R 更改表格中的字体,而不是在我的写作中更改整个文本的字体(这是技术问题)。

您可以使用gt::tab_options()函数指定字体。示例如下!

library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.5.0'

tbl <- 
  trial %>%
  select(age, grade) %>%
  tbl_summary() %>%
  as_gt() %>%
  gt::tab_options(table.font.names = "Times New Roman")

reprex package (v2.0.1)

于 2021-11-23 创建