Now on CRAN, ggdiagram is a #ggplot2 extension that draws diagrams programmatically in #Rstats. Allows for precise control in how objects, labels, and equations are placed in relation to each other.
https://wjschne.github.io/ggdiagram/articles/ggdiagram.html
@wjoelschneider This looks amazing! Question about math and LaTeX: In the docs, it says that LaTeX symbols get compiled to PDF, then converted to raster, then imported as raster. Is there a way to avoid rasterization when the plot will be saved in a vector format (e.g., purely pdf/svg-based)?

@simongrund Thanks! At some point, I hope to use a vector-based method. The current raster method works reasonably well and quickly using packages available on CRAN.

There are several ways to import svg directly. There is a method using svgparser (not on CRAN) I described here:

https://wjschne.github.io/posts/2023-07-23-latex-equation-in-ggplot2/

The marquee package can import svg images directly. I should give it another try now that a new version is out.

The xdvir package imports dvi generated by LaTeX (but for now it is very slow).

W. Joel Schneider

Importing latex into ggplot2

W. Joel Schneider
@wjoelschneider Thanks, I'll read through these. If at some point in time, a vector-based workflow gets added, that would be \*chef's kiss\*. In the meantime, these diagrams look stunning.