Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R markdown ioslides incremental mode for code chunks

How do you turn R code chunks to appear incrementally?

For example, I put the following option in the header:

---
...other configurations...
output:
  ioslides_presentation:
    incremental: true
---

But the incremental mode only applies to bullets and not to the code chunks

## Slide 1
  * this bullet point appears first
  * this bullet point appears second
```{r eval=FALSE}
# This chunk is there from the beginning
```

So my question is : How do you make the chunk appear after the second bullet?

like image 598
Alby Avatar asked Apr 27 '15 15:04

Alby


People also ask

How do I hide chunks of code in R Markdown?

Chunk options The initial line in a code chunk may include various options. For example, echo=FALSE indicates that the code will not be shown in the final document (though any results/output would still be displayed). You use results="hide" to hide the results/output (but here the code would still be displayed).

What is the difference between Ioslides and Slidy?

Slidy has more flexibility than ioslides as to appearance and style.


1 Answers

You can use the .build attribute

## Slide 1 {.build}
  * this bullet point appears first
  * this bullet point appears second
```{r eval=FALSE}
# This chunk appears third
```

There is a minor problem to this solution: On your first advancement on this slide, nothing will be displayed. You have to advance twice to make the first bullet point appear.

like image 135
wici Avatar answered Sep 24 '22 08:09

wici