我创建了一个可以在我的“查看器”中查看的数据表。如果我使用导出来复制图像或保存为 .png,它的质量往往会很低吗?
我最好的选择是截取图像并将其粘贴到我的工作文档中,我在其中输入报告,但我知道必须有更好的方法。
对我能做什么有什么建议吗?
您可以使用该saveWidget功能将数据表保存在 html 文件中,然后使用该webshot包拍摄快照。
library(DT)
library(webshot)
dtable <- datatable(iris[1:8,])
html <- "dtable.html"
saveWidget(dtable, html)
webshot(html, "dtableSnapshot.png") # you can also export to pdf
Run Code Online (Sandbox Code Playgroud)