gpt4 book ai didi

rstudio - 使用 R markdown 编织 Word .doc 时将表格标题放在顶部

转载 作者:行者123 更新时间:2023-12-01 00:49:36 24 4
gpt4 key购买 nike

在 RStudio 中使用 R markdown 编织 Word 文档时,表格标题位于表格下方。我需要表格上方的表格标题。

我尝试了 kable() 和 pander() 函数但没有成功。

可以在此处找到编织 .pdf 时使用 xtable() 的解决方案:
How to make RMarkdown (.Rmd) table captions go at the top

但是,据我所知 xtable() 在编织到 Word .doc 时不兼容。

此选项的功能在 How to position and format length of a table's title [R Markdown, pander package] 中被淡化了。由于底部表格标题的 pandoc 政策。我最近对 ​​pandoc 文档的访问表明该政策已被取消。

我想继续使用 R markdown 来编织 Word 文档,但如果表格标题保留在表格下方,我将不得不放弃。

最佳答案

根据 daroczig 的评论,我能够通过在 R 中使用以下命令安装最新版本的 pandoc 来获得解决方案:

library(installr)
install.pandoc()

请注意,重新安装最新版本的 RStudio 不会更新 pandoc。此解决方案适用于 R 3.2.2; install.pandoc() 在 R 3.1.3 中出现错误,手动安装 pandoc(即使用 msi 文件从 R 外部)没有解决问题。

关于rstudio - 使用 R markdown 编织 Word .doc 时将表格标题放在顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31971814/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com