In a .Rmd document there are several ways to produce figures side-by-side. If the figures already exist, the easiest way for me is to use knitr::include_graphics(c(fig1, fig2, ...)) [Thx: Yihui!]
But when I do this, I can't find a way to add an overall figure caption, as is easily done in LaTeX. Here is an example:
chunk
```{r, out.width = "30%", echo=FALSE}
# two figs side by side
include_graphics(c("fig/mathscore-data.png",
"fig/mathscore-data-ellipses.png"))
```
Output:
If I add a fig.cap to the chunk options, I get two separate figures, each with the same figure caption.
```{r, out.width = "30%", echo=FALSE, fig.cap="Left: scatterplot of mathscore data; Right: Data ellipses for the two groups."}
# two figs side by side
include_graphics(c("fig/mathscore-data.png",
"fig/mathscore-data-ellipses.png"))
```
Is there some other way to do what I want -- two sub-figures side-by-side, with a common caption?


