I need a single code chunk in r markdown (pdf output) to generate multiple plots and caption them, but nothing seems to be working. I tried the suggested fig.cap=c("caption1","caption2") but nothing happened, there's no caption at all. How do I manage that? Here's the code. (For some reason it's not showing the tics, they're there)
---
header-includes:
- \usepackage[croatian]{babel}
- \pagenumbering{gobble}
output:
pdf_document:
latex_engine: pdflatex
number_sections: true
fig_caption: yes
fontsize: 12pt
---
```{r, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r slika2,fig.height=3.5,fig.cap=c("kutijasti dijagram varijable age", "kutijasti dijagram dobi osoba sa srčanom bolesti")}
par(mfrow=c(1,2))
boxplot(age,col="pink")
boxplot(age[target=="1"],col="pink")
```

