在图

时间:2016-10-25 13:32:39

标签: r graph error-handling igraph

我在显示图表时收到以下消息(我正在使用igraph库):

Warning message:
In .Call("R_igraph_layout_reingold_tilford", graph, root, mode,  :
  At structural_properties.c:3297 :graph contains a cycle, partial result is returned

这是否意味着并未显示所有图表?

在这种情况下,如何跳过此错误并绘制图表?

1 个答案:

答案 0 :(得分:0)

根据文档,用于图形的布局算法用于树状图形。

 layout_reingold_tilford: Reingold-Tilford tree layout, useful for (almost) tree-like graphs.

如果您的图表包含循环,则屏幕上会显示运行时警告。 如果图是有向图,您可以将算法更改为'kk',或者您可以根据需要选择其他算法。请查看文档中的教程以获取更多信息。本教程是基于python的,但思路是一样的。 igraph Tutorial