gpt4 book ai didi

r - Knitr 忽略 width 和 out.width 选项

转载 作者:行者123 更新时间:2023-12-04 10:42:35 27 4
gpt4 key购买 nike

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

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


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


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

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

最佳答案

这个 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

关于r - Knitr 忽略 width 和 out.width 选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32977047/

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