我试图绘制一个二部图,但是有两列;该功能手册指出layout_as_bipartite()
“在二部图的简单两行(或列)布局中最小化边缘交叉”。
尝试该示例,我只能得到两个行图:
library(igraph)
library(dplyr)
# Random bipartite graph
inc <- matrix(sample(0:1, 50, replace = TRUE, prob=c(2,1)), 10, 5)
g <- graph_from_incidence_matrix(inc)
plot(g, layout = layout_as_bipartite,
vertex.color=c("green","cyan")[V(g)$type+1])
# Two columns
g %>%
add_layout_(as_bipartite()) %>%
plot()