I have this:
# Title 1
'``{r}
barplot(mtcars$mpg)
'``
text describing plot 1
# Title 2
'``{r}
barplot(mtcars$mpg)
'``
text describing plot 2
# Title 3
'``{r}
barplot(mtcars$mpg)
'``
text describing plot 3
As you see, the unit of repetition is:
# Title x
'``{r}
barplot(mtcars$mpg)
'``
text describing plot x
Is there a way to create a function that generates this unit of repetition?
Expected input that equals what I have above:
'``{r}
function_that_creates_title_graph_text(1)
function_that_creates_title_graph_text(2)
function_that_creates_title_graph_text(3)
'``