我喜欢用它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>
...
这是针对严重依赖的drakeigraph
的,我不愿意将内部转换为DiagrammeR
.