3D community network graph
Finally in this exercise you will create an interactive threejs plot with the vertices based on their community membership as produced by the fast-greedy community detection method.
Diese Übung ist Teil des Kurses
Network Analysis in R
Anleitung zur Übung
- Use the function
membership()on the community igraph objectkcto generate a vector of community membership for each vertex. - Check how many communities there are using the function
sizes()on the community igraph objectkc. - Use
set_vertex_attr()to add a vertex attribute calledcolorto the graph objectg. The values to add are the colors based on the membership assigned to objecti. - Plot the three-dimensionsal graph by using the function
graphjs()on the network objectg.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Create an object 'i' containin the memberships of the fast-greedy community detection
i <- ___(kc)
# Check the number of different communities
___(kc)
# Add a color attribute to each vertex, setting the vertex color based on community membership
g <- ___(___, "___", value = c("yellow", "blue", "red")[i])
# Plot the graph using threejs
___(___)