我正在尝试在 DiagrammeR 中使用 GraphViz 图。我怎样才能做到这一点?
myGraph = 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
}
")
然后我想在 DiagrammeR 中使用它,但它不允许。
render_graph(myGraph)
给出:
Error: class(graph) == "dgr_graph" are not all TRUE
我需要将 GraphViz 图转换或输入到 DiagrammeR 环境中吗?