knitr

library(DiagrammeRsvg)

register_knit_print()
DiagrammeR::grViz("
digraph boxes_and_circles {
  # a 'graph' statement
  graph [overlap = true, fontsize = 10]
  # several 'node' statements
  node [shape = box,
        fontname = Helvetica]
  A; B; C; D; E; F
  node [shape = circle,
        fixedsize = true,
        width = 0.9] // sets as circles
  1; 2; 3; 4; 5; 6; 7; 8
  # several 'edge' statements
  A->1 B->2 B->3 B->4 C->A
  1->D E->A 2->4 1->5 1->F
  E->6 4->6 5->7 6->7 3->8
}
")
boxes_and_circles A A 1 1 A->1 B B 2 2 B->2 3 3 B->3 4 4 B->4 C C C->A D D E E E->A 6 6 E->6 F F 1->D 1->F 5 5 1->5 2->4 8 8 3->8 4->6 7 7 5->7 6->7