LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Case Studies: Network Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • Calculate the number of nodes of the graph retweet_graph using gorder().
  • Calculate the number of edges of the graph retweet_graph using gsize().
  • Calculate graph density of the graph retweet_graph using graph.density().
  • Plot the retweet network retweet_graph.

Interaktive Übung

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

# 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(___)
Code bearbeiten und ausführen