如何从Flextable中导出表格,以使其与Rstudio查看器的外观匹配
我正在使用RSTUDIO中的Flyxable软件包将我的R输出作为表格导出到Word文档上。
该桌子在观看者上看起来不错:
net/hdnnr.png“ rel =“ nofollow noreferrer”>
” 've二手:
library(flextable)
table <- flextable(fct_count(a2, prop=TRUE))
table <- set_header_labels(table,
values = list(f = "Category") )
table <- theme_vanilla(table)
table <- autofit(table)
table
save_as_docx(
"my table 1" = table,
path = "/path/to/file.docx")
请帮助我弄清楚如何导出,以便它看起来像在观众身上一样。提前致谢。
I'm using the flextable package in RStudio to export my R output as a table onto a word document.
The table looks fine on the viewer:
However, when I try to export this onto a word document it looks like this:
Here is the script I've used:
library(flextable)
table <- flextable(fct_count(a2, prop=TRUE))
table <- set_header_labels(table,
values = list(f = "Category") )
table <- theme_vanilla(table)
table <- autofit(table)
table
save_as_docx(
"my table 1" = table,
path = "/path/to/file.docx")
Please help me figure out how to export so that it looks as it does on the viewer. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果没有可再现的例子,很难提供帮助。我会使用宽度功能,直到它按照我的需求运行为止。例如 :
Difficult to help without a reproducible example. I would play with width function until it works as I want. For example :