17.1 Basic diagrams
DiagrammeR provides methods to build graphs for a number of different graphing languages.
R Studio provides native support for Graphviz (
.gv) and mermaid (
.mmd) files. Using files of these types in RStudio provides the advantage of syntax coloring and allowing a quick preview of the diagram. For example, we can make a simple flowchart with the following code:
There are extensive controls which can be used to control the shape of nodes, colours, line types and add additional parameters.