I would like to create several plots from one chunk of R code in an RMarkdown document. The output format is beamer-presentation, I am knitting the document by hitting the knit buttom in RStudio. Here is a minimal example, where only one slide with one plot is created and the second plot is omitted. I would like to see two slides with one plot each.
---
title: "2 Plots"
output: beamer_presentation
---
# Slide with Plot
```{r cars, echo = TRUE, eval = TRUE}
plot(cars$speed)
plot(cars$dist)
```