I used graph_from_data_frame(edgelistDF, directed=TRUE, vertices=2colDF)
to construct a graph. 2colDF
holds vertexName and publicationYear (with some NAs in column 2).
If I cluster with an algorithm implemented in igraph I have the communities$names
to access vertexNames. But I don’t know how the access the second column of 2colDF
and I see :Class 'communities' hidden list of 6
in RStudio.
Question 1: How can I access additional vertex attributes in the communities object or do I need to do a manual mapping again?
I also need to use the modern Infomap implementation for clustering larger graphs and then use make_clusters(myGraph, membership=externalVector, algorithm='Infomap2.7.1)
. myGraph
has been created as mentioned above including 2colDF
. For the resulting communities
object I cannot use $names
and have no clue how to access the vertex attribute in the 2nd column but I see :Class 'communities' hidden list of 4
.
Question 2: Is there a way to access hidden lists assuming they hold what I added to the graph?
Question 3: Should I provide the external membership vector as a named vector?
While I can use communities[i]
to get names for each i=0..n-1
groups this only works for igraph clusterings but not after using make_clusters()
. Is there anything in the documentation I missed?
Many thanks.