adj <- matrix(0, 6, 6)
adj[cbind(c(1, 1, 2, 4, 4, 5, 3), c(2, 3, 3, 5, 6, 6, 4))] <- 1
adj <- adj + t(adj)
rownames(adj) <- colnames(adj) <- LETTERS[1:6]
centrality_community_based(adj, membership = c(1, 1, 1, 2, 2, 2))
centrality_comm_centrality(adj, membership = c(1, 1, 1, 2, 2, 2))
centrality_community_mediator(adj, membership = c(1, 1, 1, 2, 2, 2))
Run the code above in your browser using DataLab