I'm trying to plot a bipartite graph, but with two columns; the function manual states that layout_as_bipartite()
"Minimize[s] edge-crossings in a simple two-row (or column) layout for bipartite graphs."
Trying with the example, I can only get two row graphs:
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()