I've come across a strange Rmarkdown / ggplot2 interaction:
---
title: "Wrong order of ggplot figures from a loop"
output: html_notebook
---
For i > 3 this chunk does not keep the figues in the correct order:
```{r}
library(ggplot2)
for (i in 1:4)
{
p <- ggplot(data = mpg) +
geom_point(mapping = aes(x = displ, y = hwy)) +
ggtitle(i)
print(p)
}
```
R 3.5.0, RStudio 1.1.463, all packages updated to the latest version
Can anyone else reproduce this?