Visualize nodes by degree
Now that we've taken a look at our graph and explored some of the basic properties of it, let's think a bit more about our network. We observed that there are some highly connected nodes and many outlier points. We visualize this by conditionally plotting the graph and coloring some of the nodes by in and out degree. Let's think about the nodes as three different types:
- high retweeters and highly retweeted.
- users who retweeted only once (have an in-degree of 0 and an out-degree of 1).
- users who were retweeted only once (have an in-degree of 1 and an out-degree of 0).
This will help us get more information about what's going on in the ring around the cluster of highly connected nodes.
This exercise is part of the course
Case Studies: Network Analysis in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Calculate the "in" degree distribution of retweet_graph
in_deg <- degree(___, mode = "___")
# Calculate the "out" degree distribution of retweet_graph
out_deg <- degree(___, mode = "___")
# Find the case with one "in" degree and zero "out" degrees
has_tweeted_once_never_retweeted <- __ == 1 & __ == 0
# Find the case with zero "in" degrees and one "out" degree
has_never_tweeted_retweeted_once <- __ == 0 & __ == 1