|
From: | Soós Albert |
Subject: | Re: Re: [igraph] Running time |
Date: | Fri, 30 Jul 2010 19:09:46 +0200 |
Hello! Thanks for the fast reply. I have another question, how can i draw the result of a clustering? I found an example int he tutorial: g <- graph.full(5) %du% graph.full(5) %du% graph.full(5) g <- add.edges(g, c(0,5, 0,10, 5,10)) com <- spinglass.community(g, spins=5) V(g)$color <- com$membership+1 g <- set.graph.attribute(g, "layout", layout.kamada.kawai(g)) plot(g, vertex.label.dist=1.5) I read my input graphs, and i use the fastgreedy or the edge betweenness algorithm so i modified the code: graph<- read.graph(file=C:/g, format=”edgelist”, directed=FALSE) com <- fastgreedy.community(graph, merges=TRUE, modularity=TRUE, weights=NULL) V(graph)$color <- com$membership+1 graph <- set.graph.attribute(graph, "layout", layout.kamada.kawai(graph)) plot(graph, vertex.label.dist=1.5) It draws the graph with the given layout, but it doesn’t color the communities. Albert -- Eredeti üzenet --
|
[Prev in Thread] | Current Thread | [Next in Thread] |