Visualize the graph
Now that we've thought a bit about how we constructed our network, let's size our graph and make an initial visualization. Before you make the plot, you'll calculate the number of vertices and edges. This allows you to know if you can actually plot the entire network. Also, the ratio of nodes to edges will give you an intuition of just how dense or sparse your plot might be. As you create your plot, take a moment to hypothesize what you think the plot will look like based on these metrics.
Cet exercice fait partie du cours
Case Studies: Network Analysis in R
Instructions
- Calculate the number of nodes of the graph
retweet_graphusinggorder(). - Calculate the number of edges of the graph
retweet_graphusinggsize(). - Calculate graph density of the graph
retweet_graphusinggraph.density(). - Plot the retweet network
retweet_graph.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Count the number of nodes in retweet_graph
___
# Count the number of edges in retweet_graph
___
# Calculate the graph density of retweet_graph
___
# Plot retweet_graph
plot(___)