I hope the question is correctly stated. I would like to create, for didactic purposes, a knitr document where the outputs of the R base graphics system and the outputs of the Lattice package are compared in a panel. Consider a numeric vector:
```{r dataload}
e2 <- c(72, 79, 81, 80, 63, 62, 89, 90, 50, 78, 87, 97, 55, 69, 97, 87,
88, 99, 76, 78, 65, 77, 88, 90, 81)
```
I tried to produce a panel with the following code:
```{r plots}
par(mfrow = c(1,2)) #Set 1 row 2 columns panel
hist(e2) #Base graphic histogram on the left
histogram(~e2) #Lattice histogram on the right
```
But the Lattice histogram closes the panel, deleting the Base graphics histogram.
Expected result:
The panel should report the Base graph on a side and the Lattice graph on the other, similarly to the product of this really beautiful post. Unfortunately, the blog does not explain how the result is produced, and I did not find further information on the problem. I could easily produce two different images, but I think the panel representation produces a more beautifully comparable result
Thank you very much for your patience.