adj <- matrix(c(0, .5, 0,
.2, 0, .7,
0, 0, 0), 3, 3, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
to_undirected(adj, method = "sum")
to_undirected(adj, method = "mutual")
Run the code above in your browser using DataLab