adj <- matrix(c(0, .5, .8, 0,
.5, 0, .3, .6,
.8, .3, 0, .4,
0, .6, .4, 0), 4, 4, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C", "D")
# Top 3 edges by weight
select_top_edges(adj, n = 3)
# Top 2 by edge betweenness
select_top_edges(adj, n = 2, by = "edge_betweenness")
Run the code above in your browser using DataLab