MulaiMulai sekarang secara gratis

Who is important in the conversation?

Different measures of centrality all try to get at the similar concept of "which vertices are most important." As we discussed earlier, these two metrics approach it slightly differently. Keep in mind that while each may give a similar distribution of centrality measures, how an individual vertex ranks according to both may be different. Now we're going to compare the top ranking vertices of Twitter users.

The vectors that store eigen and betweenness centrality are stored respectively as retweet_ec and retweet_btw.

Latihan ini adalah bagian dari kursus

Case Studies: Network Analysis in R

Lihat Kursus

Petunjuk latihan

  • Calculate the 0.99 quantile of the betweenness, retweet_btw.
  • Subset retweet_btw for values greater than this quantile to keep the top 1%.
  • Do the same for eigen-centrality, retweet_ec.
  • Run the code that puts these in a data frame and look at the results.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Get 0.99 quantile of betweenness 
betweenness_q99 <- quantile(___, ___)

# Get top 1% of vertices by betweenness
top_btw <- ___[retweet_btw > ___]

# Get 0.99 quantile of eigen-centrality
eigen_centrality_q99 <- ___(___, ___)

# Get top 1% of vertices by eigen-centrality
top_ec <- ___

# See the results as a data frame
data.frame(
  Rank = seq_along(top_btw), 
  Betweenness = names(sort(top_btw, decreasing = TRUE)), 
  EigenCentrality = names(sort(top_ec, decreasing = TRUE))
)
Edit dan Jalankan Kode