How can I incrementally build a plot in an ioslide presentation using Rmarkdown?

可紊 提交于 2020-05-27 05:04:05

问题


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?


回答1:


After the slide title

<div class="incremental">  

And then at the end

</div>


来源:https://stackoverflow.com/questions/24565438/how-can-i-incrementally-build-a-plot-in-an-ioslide-presentation-using-rmarkdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!