将igraph转换为DiagrammeR图的问题

时间:2017-03-23 19:20:09

标签: r igraph diagrammer

我喜欢使用igraph来创建和操作图形,我想使用DiagrammeR来制作图形的漂亮可视化。我无法将我的igraph转换为DiagrammeR格式。

> library(igraph)
> library(DiagrammeR)
> g = make_empty_graph() + vertices(c("a", "b")) + edge("a", "b")
> x = from_igraph(g)
Warning messages:
1: In data.frame(from = as.integer(igraph::ends(igraph, igraph::E(igraph))[,  :
  NAs introduced by coercion
2: In data.frame(from = as.integer(igraph::ends(igraph, igraph::E(igraph))[,  :
  NAs introduced by coercion
> x
$graph_info
  graph_id     graph_name          graph_time graph_tz write_backups
1 6Z3ljgDB graph_6Z3ljgDB 2017-03-23 15:14:01     <NA>         FALSE

$nodes_df
  id type label
1  1 <NA>  <NA>
2  2 <NA>  <NA>
...

这适用于drake,它严重依赖igraph,我不愿意将内部转换为DiagrammeR

0 个答案:

没有答案