[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] "Assigned" Communities and Modularity

From: Walter McHugh
Subject: [igraph] "Assigned" Communities and Modularity
Date: Tue, 12 May 2015 17:33:24 -0400


   I am trying to compare network scale modularity scores for my network using various community types.  The first types are what are generated algorithmically, such as walktrap.  However, I would also like to assign each vertex a community of my choosing and calculate modularity using the assigned communities.  I have tried to do this by creating a vector that mimics the output of running member() on a walktrap output.  The vector:

>> v = attrib$edgroup
>> names(v) = attrib$vertex

where attrib$edgroup is a column that has my choice of "community" in integer form, and attrib$vertex are the "names" of the vertices in the graph. if I run the following, 

>> modularity(graph1,v)

then R crashes.  I also tried to clone a "communities" object, using instructions from the following URL: https://lists.nongnu.org/archive/html/igraph-help/2012-03/msg00075.html but using the typical syntax also causes R to crash:

>> modularity(graph1, membership(comms))

What's the best way to do what I'm asking?



Walter McHugh
Interdisciplinary M.A, Statistical Methods and Data Science
Northeastern University
Boston, MA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]