You can place multiple figures side by side using the fig.show="hold" along with the out.width option. In the example below, we have set out.width="50%" (see Figure 9.2 for the output):

    1. ```{r, figures-side, fig.show="hold", out.width="50%"}
    2. par(mar = c(4, 4, .1, .1))
    3. plot(cars)
    4. plot(mpg ~ hp, data = mtcars, pch = 19)
    5. ```

    Image 1: Side-by-side figures.Image 2: Side-by-side figures.

    FIGURE 9.2: Side-by-side figures.

    This simple approach works for both PDF and HTML output.

    If you want to use sub-figures when there are multiple plots in a figure, you may see Section 6.6, but please note that sub-figures are only supported in LaTeX output.