Is it possible to conditionally evaluate a code chunk and its associated heading using R Markdown and knitr
? For example, if eval_cell
is TRUE
include the chunk and its heading, but don't include either if eval_cell
is FALSE
.
```{r}
eval_cell = TRUE
```
# Heading (would like to eval only if eval_cell is TRUE)
```{r eval = eval_cell}
summary(cars)
```