Joe*_*Joe 5 markdown r rstudio knitr
对于pdf图形,fig.width和fig.height块选项仅更改了我的Word文档中2“ x2”图形的比例。我似乎无法控制pdf图形的大小,就像将R Markdown编织成word文档的png图形一样。
---
title: "Controlling PDF figure size in MS Word output"
output: word_document
---
```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.path='02_Figs/', fig.show='asis', dev = 'pdf',
include=FALSE, warning=FALSE, message=FALSE)
```
# Fig. 1. Small Plot
```{r include=TRUE, echo=FALSE, fig.width=2, fig.height=3, fig.keep='high'}
with(mtcars, plot(mpg~wt))
```
# Fig. 2. Big Plot
```{r include=TRUE, echo=FALSE, fig.width=4, fig.height=6, fig.keep='high'}
with(mtcars, plot(mpg~wt))
```
Run Code Online (Sandbox Code Playgroud)