r - Inconsistency when plotting communities grouping -


I have a problem in creating conspiracy of communities Please consider following MWE

  Library (Igraph) m & lt; - Matrix (c (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 , 0,1,0, 4,1,0,0,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0), Nrow = 6, Ncol = 6) g & lt; - graph.adjacency (m) memb & lt; - Membership (edge.betweenness.community (g)) memb # [1] 1 1 2 1 2 2 I hope to see two communities in the plot  
  plot (g, mark.groups = list (memb), edge.width = 0.5, edge.arrow width = 0.2)   

But in fact only one community

Enter image details here

Do I have something Am doing wrong

If I understand your question correctly, you can write mark.groups Arguments are using the wrong. Try

  plot (g, mark.groups = lapply (unique (memb), function (n) which (memb == n)), edge.method = 0.5, edge. Width = 0.2)    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -