ziy*_*ang 0 html5 r ggplot2 knitr
这是我有问题的幻灯片:
这张幻灯片的纯文本是
# Title
```{r plot, echo=FALSE}
library("ggplot2")
x <- seq(-1,1,0.05)
y <- x^3/3-x^2 + rnorm(41,sd=0.1)
qplot(x,y)+geom_smooth()
```
- item 1
- item 2
Run Code Online (Sandbox Code Playgroud)
我想:
你能给我一些提示吗?谢谢.
你应该花些时间阅读提供的精彩文档knitr
.
在不知道你的工作流程来创建幻灯片的情况下,html5的结尾很难回答.
您正在寻找fig.width
,fig.height
,fig.cap
,warning
并message
从knitr
块的选项.
```{r plot, echo=FALSE,fig.width = 3, fig.height = 3, fig.cap = '', warning = FALSE, message = FALSE, cache = FALSE}
library("ggplot2")
x <- seq(-1,1,0.05)
y <- x^3/3-x^2 + rnorm(41,sd=0.1)
qplot(x,y)+geom_smooth()
```
- item 1
- item 2
Run Code Online (Sandbox Code Playgroud)
您必须调整高度和宽度以获得适合幻灯片的大小