- out <- list(graph = g.toplot, mat.eff = mat.eff, eff = eff, mat = mat.simi, v.label = v.label, we.width = we.width, we.label=we.label, label.cex = label.cex, layout = lo)
+ if (!is.null(communities)) {
+ if (communities == 0 ){ #'edge.betweenness.community') {
+ com <- edge.betweenness.community(g.toplot)
+ } else if (communities == 1) {
+ com <- fastgreedy.community(g.toplot)
+ } else if (communities == 2) {
+ com <- label.propagation.community(g.toplot)
+ } else if (communities == 3) {
+ com <- leading.eigenvector.community(g.toplot)
+ } else if (communities == 4) {
+ com <- multilevel.community(g.toplot)
+ } else if (communities == 5) {
+ com <- optimal.community(g.toplot)
+ } else if (communities == 6) {
+ com <- spinglass.community(g.toplot)
+ } else if (communities == 7) {
+ com <- walktrap.community(g.toplot)
+ }
+ } else {
+ com <- NULL
+ }
+
+ out <- list(graph = g.toplot, mat.eff = mat.eff, eff = eff, mat = mat.simi, v.label = v.label, we.width = we.width, we.label=we.label, label.cex = label.cex, layout = lo, communities = com, halo = halo)