I have saved the 2 images below into my working directory named bl_convergence_acorr001.png
and bl_convergence_acorr002.png
respectively. My goal is to add those images in a word document. But the number of images may not be static like this example but dynamic. So my thought was to create a list in which those names will be saved. The same logic must be applied for the titles as well. The first should be named Figure 1
, the second Figure 2
etc. How can I pass the code that adds the image inside the for()
loop?
---
title: "My Title"
author: "Me"
date: "1/1/2016"
output: bookdown::word_document2
---
```{r cars, echo=FALSE,fig.cap = ". (m_BARI_POP1_3_PRIMARY_12_ACR20_independent_fixed_fixed, logit_independent_fixed_fixed) Baseline Autocorrelation plots"}
knitr::include_graphics("bl_convergence_acorr001.png")
```
```{r cars2, echo=FALSE,fig.cap = ". (m_BARI_POP1_3_PRIMARY_12_ACR20_independent_fixed_fixed, logit_independent_fixed_fixed) Baseline Trace plots"}
knitr::include_graphics("bl_convergence_acorr002.png")
```