2

The function DiagrammeR::grViz() produces an object of class "grViz" and "htmlwidget". Unfortunately, most functions in DiagrammeR assume your graph is a drg_graph object and so you cannot simply pass the output of grViz to those functions.

Is there some way to convert the type of the object so as to use the functions from DiagrammeR, such as features to combine two graphs into one file or save the graph with specified dimensions and formatting?

library(DiagrammeR)

# Make graph
simple <- grViz("
digraph dot {

    # Graph statements
    graph [layout = dot, overlap = false]

    # Node statements
    node [shape = box, fontname = Helvetica]
    a
    b
    e

    # Edge statements
    a -> b;
    b -> e;
} 
")

# Check class
class(simple)
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
socialscientist
  • 3,759
  • 5
  • 23
  • 58

0 Answers0