I am trying to include a graph built with the diagrammeR package in an RPres. That's the graph:
library(DiagrammeR)
mermaid("graph TD
X1(X1)-->Z1(Z2)
X2(X2)-->Z2(Z2)
X1(X1)-->Z2(Z2)
Z1(Z1)-->Y(Y)
Z2(Z2)-->Y(Y)
")
Looking at the output in RStudio's viewer pane is no problem. No I include it in an RPres:
Untitled
========================================================
author:
date:
autosize: true
First Slide
========================================================
```{r,echo=FALSE, results = "asis"}
library(DiagrammeR)
mermaid("graph TD
X1(X1)-->Z1(Z2)
X2(X2)-->Z2(Z2)
X1(X1)-->Z2(Z2)
Z1(Z1)-->Y(Y)
Z2(Z2)-->Y(Y)
")
(note that the "```" to close the code chunk aren't displayed here because of markup...)
Alas, nothing but the abyss of emptiness:

Are you committed to
RPresor would you consider alternative slide formats? For example, if you create a new R Markdown document and specifyoutput: ioslides_presentationin the YAML header, the diagram will render properly:Which produces this: