gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 04:54:03 25 4
gpt4 key购买 nike

我有个客户想用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/

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