I\'m writing an RMarkdown document in which I\'d like to re-run some chunks (5 to 9). There\'s no need to display these chunks again, so I considered using
If you add an html tag before your code you can use CSS selectors to do clever things to bits of the output - markdown handily passes the HTML through:
```{r}
summary(cars)
```
Here my CSS style rule matches the first Now you know how to match the code and output blocks in CSS, you can do all sorts of clever things with them in Javascript. You could put something in the The next step in complexity is to make the action toggle, but then you might as well use ( Note: I thought you could wrap R chunks in but that fails - anyone know why?) tag after a tags - one for the R and one for the output, and this CSS catches the first one.
jQuery and get real funky. Or use this simple method. Let's do it with a button, but you also need a div to get your hooks into the R command PRE block, and the traversal gets a bit complicated:
```{r}
summary(cars)
```