[igraph] Plot communities difficulty

5 views
Skip to first unread message

Gmail

unread,
Nov 9, 2012, 9:55:25 PM11/9/12
to Help for igraph users
Hello,

I'm trying to plot the results from the edge.betweenness.community analysis as a dendrogram.  When I started trying the dendPlot function was working good but know when I try to change some parameters (like hang or use.modularity) i get an error, and I only get the plot when I just specify the "mode" in the function and everything else is on default.

> dendPlot(ebc, mode="hclust", hang=-1, use.modularity=TRUE)  This red parameters, at least, give me the error. When I add others I get other errors
Error in xS[[in.k]] : attempt to select less than one element

> dendPlot(ebc, mode="hclust", rect=3, colbar=rainbow(rect))
Error in n[1L] : object of type 'closure' is not subsettable

Probably is due to my inexperience, but maybe not… can you help? I use Mac

Best,

Silvia

Gábor Csárdi

unread,
Nov 11, 2012, 12:32:10 AM11/11/12
to Help for igraph users
Hi Silvia,

On Fri, Nov 9, 2012 at 9:55 PM, Gmail <soli...@gmail.com> wrote:
[...]

> dendPlot(ebc, mode="hclust", hang=-1, use.modularity=TRUE)  This red parameters, at least, give me the error. When I add others I get other errors
Error in xS[[in.k]] : attempt to select less than one element

I cannot reproduce this, so you'll need to send a reproducible example. Thanks.
 

> dendPlot(ebc, mode="hclust", rect=3, colbar=rainbow(rect))
Error in n[1L] : object of type 'closure' is not subsettable

You cannot refer to the supplied value of another function argument this way. You need to explicitly say `colbar=rainbow(3)' or really create a variable called 'rect', and then use that to call the function. E.g.:

library(igraph)
g <- graph.full(5) + graph.full(5) + edge(1,6)
ebc <- edge.betweenness.community(g)

layout(rbind(1:2,3:4))
dendPlot(ebc)
dendPlot(ebc, mode="hclust", hang=-1, use.modularity=TRUE)
dendPlot(ebc, mode="hclust", rect=3, colbar=rainbow(3))

Gabor



Probably is due to my inexperience, but maybe not… can you help? I use Mac

Best,

Silvia

_______________________________________________
igraph-help mailing list
igrap...@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help




--
Gabor Csardi <csa...@rmki.kfki.hu>     MTA KFKI RMKI

Reply all
Reply to author
Forward
0 new messages