r - 如何更改 Rmarkdown 中元文件图形输出的尺寸?

标签 r r-markdown metafile

我有个客户想用Rmarkdown把图做成Word文档然后编辑(我知道。。。不是真正的可复现研究的重点,但这是客户想要的。。。)

 ----
 title: "MinReproEx_Metafile" 
 author: "Erika Mudrak" 
 date: "Thursday, July 17, 2014" 
 output: word_document
 ----

 Try to put a bigger metafile figure in a work document 

 ```{r, echo=FALSE, dev='win.metafile', fig.height=6, fig.width=6}
 plot(cars) 
 ```

使用 dev='win.metafile' 将图形放置为可编辑的图元文件,但不管 fig.heightfig.width< 的输入如何 这个数字是 1.67 x 1.67 英寸。所以 dev='win.metafile' 以某种方式覆盖了这些 block 选项。

knitr 选项页面有关于 dev.args 的内容:

dev.args: (NULL) more arguments to be passed to the device, e.g. dev.args=list(bg='yellow', pointsize=10); note this depends on the specific device (see the device documentation); when dev has multiple elements, dev.args can be a list of lists of arguments with each list of arguments to be passed to each single device, e.g. <>=

我在哪里可以找到它所指的图元文件格式的设备文档?

最佳答案

试试 out.height=6, out.width=6。 (尝试不同的数字) 如果还是不行,就告诉他们从 figure/ 文件夹(通常和你的 Rproj 在同一个目录)中复制图形,然后粘贴到他们的 doc 文件中。如果 cache=TRUEKnitr 会将所有图形保存在您的计算机中。

关于r - 如何更改 Rmarkdown 中元文件图形输出的尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24807254/

相关文章:

r - 包的安装具有非零退出状态 - Linux 服务器

r - R中的排序月份

html - 如何使用 flexdashboard 添加指向 Logo 的链接?

r - 使用 R 的军官包将图标添加到依赖于列值的 powerpoint 项目符号

pdf - rmarkdown中pdf和word的分页符

c++ - 使用 C++ 中的 SetWinMetaFileBits api 将 wmf 文件转换为 emf 文件

r - 在使用 facet_wrap 创建的直方图上绘制均值

r - 函数总是返回数字(0)

vb.net - 将 VB 代码转换为 Delphi(将从 EMF 文件中提取图像)