Chart Notes are Not Shown in Flexdashboard if an Empty Chunk is Added at the End

31 Views Asked by At

When adding a final chunk after the last chart chunk in a flexdashboard the notes (the text added below the chart via > ...) are silently dropped.

If you remove the final chunk (clean-up-chunk) the notes will re-appear.

This strikes me to be a bug, but before I issue a bug report, I am wondering whether this is maybe by design and we should not add empty (i.e. no graphical output producing) chunks at the end?

Code

---
title: "Clean Up Chunk is Bad"
output:
  flexdashboard::flex_dashboard:
    orientation: rows
---

```{r}
library(plotly)
```

## Row

### A Chart

```{r chart-chunk}
plot_ly(x = 1, y = 10, type = "bar")
```
> Text not shown if chunk `clean-up-chunk` is added at the end

```{r clean-up-chunk}
### Remove this chunk altogether to make the note re-appear again
### Usage: for example to close a db connection
## dbDisconnect(con)
```

Screenshot

Rendered Flexdashboard with teh Note below the Chart missing

0

There are 0 best solutions below