如何使用 Rmarkdown 在 ioslide 演示文稿中逐步构建绘图? [英] How can I incrementally build a plot in an ioslide presentation using Rmarkdown?
问题描述
我正在尝试使用 Rmarkdown 在一张幻灯片上逐步构建绘图以创建 ioslides (HTML) 演示文稿.我试过使用 {.build} 但无济于事,似乎 Rmarkdown 社区中没有关于此的文档.有谁知道如何用 R 编写这段代码?
这是一个 MWE,我尝试分三个步骤构建一个图,从空白图到散点图再到线图,所有这些都在一张幻灯片中,通过一次单击向前一个图展开:
---书名:《无题》作者:用户"日期:07/03/2014"输出: ioslides_presentation---## 幻灯片标题```{r, echo=FALSE}x <- 范数(10)`````{r, echo=FALSE, fig.align='center'}情节(1:10,x,type='n')`````{r, echo=FALSE, fig.align='center'}情节(1:10,x,type='p')`````{r, echo=FALSE, fig.align='center'}情节(1:10,x,type='b')``
对如何获得这个有任何想法吗?
幻灯片标题后
然后在最后
I'm trying to build a plot incrementally on one slide using Rmarkdown to create an ioslides (HTML) presentation. I've tried using {.build} but to no avail, and it seems there is no documentation on this in the Rmarkdown community. Does anyone know how to write this code in R?
Here is a MWE where I try to build a plot in three steps, from a blank plot to a scatterplot to a lineplot, all in one slide where the plots unfold by clicking forward one at a time:
---
title: "Untitled"
author: "User"
date: "07/03/2014"
output: ioslides_presentation
---
## Slide Title
```{r, echo=FALSE}
x <- rnorm(10)
```
```{r, echo=FALSE, fig.align='center'}
plot(1:10,x,type='n')
```
```{r, echo=FALSE, fig.align='center'}
plot(1:10,x,type='p')
```
```{r, echo=FALSE, fig.align='center'}
plot(1:10,x,type='b')
```
Any thoughts on how to get this?
After the slide title
<div class="incremental">
And then at the end
</div>
这篇关于如何使用 Rmarkdown 在 ioslide 演示文稿中逐步构建绘图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!