I have a bunch of pre-saved plots inside a folder. I have a Rmarkdown(Flexdashboard) looping this folder and showing a picture per tab this way (an example taking just one)
```{r ,results="asis"}
list_plots <- list.files(plots_folder,pattern = ".png", full.names = TRUE)
cat(" \n###", "Tab Name \n")
knitr::include_graphics(list_plots[1])
cat(" \n")
```
this worked flawlessly. My issue is when using a loop. The tabs are rendered but no plot inside. This way:
```{r ,results="asis"}
list_plots <- list.files(plots_folder,pattern = ".png", full.names = TRUE)
for(i in plots) {
cat(" \n###", "tab name \n")
knitr::include_graphics(i)
cat(" \n")
}
```