Knitr忽略宽度和out.width选项

时间:2015-10-06 18:27:37

标签: r rstudio knitr r-markdown

我有一个R Markdown,我在RStudio中编织html。我可以使用fig.width和fig.height来调整我的绘图的分辨率,但我似乎无法加宽页面输出,以便文本输出不会换行或使得绘图看起来物理上更大。我试过了:

```{r}
options(width=2000)
```

```{r}
knitr::opts_knit$set(width=2000)
```

```{r,out.width=2000}
```

输出页面宽度永远不会改变。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

此Rmd文件生成不同的绘图大小:

---
title: "Untitled"
author: "Me"
date: "6 - 10 - 2015"
output: html_document
---
I have a R Markdown that I knit to html from within RStudio. I can use fig.width and fig.height to adjust the resolution of my plots but I can't seem to widen the page output so that text output doesn't wrap or so that the plots appear physically larger. I have tried:

```{r}
options(width=2000)
```
and

```{r}
knitr::opts_knit$set(width=2000)
plot(cars)
```
and

```{r,out.width=2000}
#using out.width=2000
plot(cars)
```
or
```{r,fig.width=4}
#using fig.width=4
plot(cars)
```

enter image description here