require(tidygraph)
gr <- create_notable('zachary') %>%
mutate(group = group_infomap()) %>%
morph(to_split, group) %>%
activate(edges) %>%
mutate(edge_group = as.character(.N()$group[1])) %>%
unmorph()
ggraph(gr, 'matrix', sort.by = node_rank_hclust()) +
geom_edge_point(aes(colour = edge_group), mirror = TRUE, edge_size = 3) +
scale_y_reverse() +
coord_fixed() +
labs(edge_colour = 'Infomap Cluster') +
ggtitle("Zachary' Karate Club")
Run the code above in your browser using DataLab