The
When using plotly
(or anything else I have tested) it works as expected as shown on plots 3 and 4
Could you help me fix it, I am happy with testing for the class of the object obj_to_rmd
receives.
PS: rmd
code in_tabs
generates can be seen by running in_tabs(..., knit = FALSE)
. For instance
in_tabs(lapply(l1, FUN = gplot), labels = names(l1), level = 1L, knit = FALSE)
```{r, echo = FALSE}
plot(l$`p1`)
```
CodePudding user response:
As stefan mentioned, the issue is with the ggplot's id, since they somehow have the same code chunk, even though you named the chunks differently.I don't know the reason for this behaviour, but you can bypass it by setting
```{r, include=FALSE}
options(knitr.duplicate.label = "allow")
```
at the beginning of your document. That should do the trick. It will give different chunk names to each of your plots. You can verify that by removing results = "asis"
from your ggplots to see that they no longer have the same id.
You can read more about allowing duplicated chunks at