LoslegenKostenlos loslegen

Visualizing the communities

Now that we've found communities, we'll visualize our results. Before we plot, we'll assign each community membership to each vertex and a crossing value to each edge. The crossing() function in igraph will return true if a particular edge crosses communities. This is useful when we want to see certain vertices that are bridges between communities. You may just want to look at certain communities because the whole graph is a bit of a hairball. In this case, we'll create a subgraph of communities only of a certain size (number of members).

Diese Übung ist Teil des Kurses

Case Studies: Network Analysis in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Color vertices by community membership, as a factor
V(retweet_graph)$color <- factor(___(___))

# Find edges that cross between commmunities
is_crossing <- crossing(___,___)

# Set edge linetype: solid for crossings, dotted otherwise 
E(retweet_graph)$lty <- ifelse(___, "solid","___")
Code bearbeiten und ausführen