Dear all,
I have a correlation matrix, which I transform into a graph and then I try to obtain community memberships with cluster_spinglass function (example below). When there are more vertices, the number of spins and the composition of it (membership) is different evry time you perform the function. Therefore, I'm trying to obtain frequencies by performing iterations. My goal is to obtain frequencies in order to understand which are the communities that appear most frequently, and also which is the most frequent solution found by cluster_spinglass (a combination of membership data plus number of groups). I noticed that component_distribution() should do something like this, but I don't really understand how to use it, as it gives me back a different membership (all vertices in the same group) as that from cluster_spinglass. Does anyone have an idea of how to perform iterations and get a cumulative distribution (relative frequency) of the clusters formed? I tried to perform iterations and use component_distribution, but the object is not a graph. Thank you in advance. >d <- data.frame(x1=rnorm(20), x2=rnorm(20), x3=rnorm(20), x4=rnorm(20), x5=rnorm(20), x6=rnorm(20)) >graph<-graph_from_adjacency_matrix(cor(d),mode="undirect",weighted=T,diag=F,add.colnames=NULL,add.rownames=NA) > >communities<-cluster_spinglass(graph,weights = NULL) >membership(communities,weights = NULL) >iterations<-replicate(n=100,expr=communities,simplify="array") >component_distribution(iterations,cumulative=TRUE) -- Institut des Sciences de l'Evolution UMR5554, CNRS, IRD, EPHE Université de Montpellier Place Eugène Bataillon 34095 Montpellier Cedex 05 France Email: sergio.ferreira-card...@umontpellier.fr Tel: +33 (4 ) 67 14 46 52
_______________________________________________ igraph-help mailing list igraph-help@nongnu.org https://lists.nongnu.org/mailman/listinfo/igraph-help