MulaiMulai sekarang secara gratis

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).

Latihan ini adalah bagian dari kursus

Case Studies: Network Analysis in R

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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","___")
Edit dan Jalankan Kode