Yes, Carl's explanation is absolutely correct. You need ![]() in a
separate paragraph to get figure captions in HTML, as documented here:
http://johnmacfarlane.net/pandoc/README.html#images
The trick here is to add some line breaks between the two images:
---
output:
html_document:
fig_caption: yes
---
# A minimal R Markdown example
A _paragraph_ here.
```{r, fig.cap=c("hello", "bye"), echo=FALSE, fig.retina=1}
plot(1:10)
cat('\n\n')
hist(rnorm(1000))
```
Note the chunk option fig.retina=1: without it, rmarkdown::render()
will generate plots for Retina displays, which means the plots are
written in raw <img> tags instead of ![](), and Pandoc will not be
able to generate figure captions in that case.
Regards,
Yihui
--
Yihui Xie <
xiey...@gmail.com>
Web:
http://yihui.name