是否可以使用GTSummary表(或将GT对象转换为GTSummary对象)?

发布于 2025-02-01 18:48:56 字数 551 浏览 7 评论 0原文

这是我的情况:

  1. 我使用gtsummarytbl_summary class变量上创建
  2. 我需要使用gtsummary - 但是,我需要进行一些格式化。需要gt函数
  3. ,因此,我将我的tbl_summary转换为gt_tbl使用as_gt()
  4. 问题是现在可以不再导出到MS Word,也不能转换回tbl_summary

因为gtsummary是围绕gt的包装器,似乎应该有一种方法要么:

  1. 使用gt直接在gtsummary对象上函数而无需转换它,或
  2. gt对象转换为gtsummary 对象

Here is my situation:

  1. I use gtsummary to create at tbl_summary class variable
  2. I need to do some formatting that is not possible with gtsummary - but instead requires gt functions
  3. Therefore, I convert my tbl_summary to a gt_tbl using as_gt()
  4. The problem is that now can no longer export to MS Word, nor can I convert back to tbl_summary

Since gtsummary is a wrapper around gt it seems like there should be a way to either:

  1. Use gt functions directly on the gtsummary object without converting it, or
  2. Convert the gt object back to a gtsummary object

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海夜未眠 2025-02-08 18:48:56

您有几个选择:

  1. 而不是单词输出,而是使用RTF。 RTF由Word和{GT}软件包支持。
  2. 如果您需要坚持单词输出,则需要使用{Flextable}执行其他格式,例如tbl_summary(... ;

There are a couple of options for you:

  1. Instead of Word output, use RTF. RTF is supported by Word and the {gt} package.
  2. If you need to stick with Word output, you'll need to use {flextable} to perform the additional formatting, e.g. tbl_summary(...) %>% as_flex_table() %>% <flextable formatting functions>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文