Uncover code chunk in Rmarkdown and beamer

Viewed 205

is it possible to reveal code chunks when using beamer and Rmarkdown? The following gives an error because of the # around the output, I think.

---
title: "test"
output: beamer_presentation
---

# Test Reveal
Text

\visible<2->{
Code
```{r}
print(2 + 2)
```
}
1 Answers

You can achieve a very similar effect by using a \pause before your code block:

---
title: "test"
output: beamer_presentation
---

# Test Reveal
Text

\pause
Code
```{r}
print(2 + 2)
```
Related