Last active
November 23, 2019 17:49
-
-
Save cderv/a3926f55f92b869d877a5f2a5fb2cc4e to your computer and use it in GitHub Desktop.
Test for knitr issue on include_graphics (https://github.com/yihui/knitr/pull/1776)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one graphic | |
```{r, fig.cap = "This is a caption for unique figure"} | |
knitr::include_graphics("test-1.png") | |
``` | |
# Three graphics in the same chunk | |
Using three times `include_graphics` | |
```{r, fig.cap = "This is a caption", out.width = "33%", fig.show = "hold"} | |
knitr::include_graphics("test-1.png") | |
knitr::include_graphics("test-2.png") | |
knitr::include_graphics("test-3.png") | |
``` | |
```{r, fig.cap = "This is another caption", out.width = "33%", fig.show = "hold"} | |
knitr::include_graphics(c("test-1.png", "test-2.png", "test-3.png")) | |
``` | |
# mixing with plot | |
```{r, fig.cap = "This is a caption", out.width = "33%", fig.show = "hold"} | |
knitr::include_graphics("test-1.png") | |
plot(iris) | |
knitr::include_graphics("test-2.png") | |
1+1 | |
knitr::include_graphics("test-3.png") | |
``` | |
```{r, fig.cap = c("This is a caption", "This is another", "this is a plot", "And a last"), out.width = "33%"} | |
knitr::include_graphics(c("test-1.png", "test-2.png")) | |
plot(iris) | |
1+1 | |
knitr::include_graphics("test-3.png") | |
``` | |
# Placing on top | |
```{r, fig.cap = "This is a caption", out.width = "33%", fig.show = "hold", fig.topcaption = TRUE} | |
knitr::include_graphics("test-1.png") | |
knitr::include_graphics("test-2.png") | |
knitr::include_graphics("test-3.png") | |
``` | |
```{r, fig.cap = "This is another caption", out.width = "33%", fig.show = "hold", fig.topcaption = TRUE} | |
knitr::include_graphics(c("test-1.png", "test-2.png", "test-3.png")) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment