Exercise

More ggnet Plotting Options

The real power of ggnet and other alternatives to igraph is that they offer a way to generate advanced plots with just a little parameterization. In the earlier example comparing the two plotting methods, they were somewhat similar. However, in this lesson we'll show how you can make more advanced plots. We'll take the Twitter data set and using igraph add several vertex attributes, centrality and community, and plot them quickly using ggnet.

The centrality and community membership attributes you created in the last exercise are still present.

Instructions 1/2

undefined XP
    1
    2
  • Use asNetwork() to convert retweet_graph to a ggnet graph.
  • Use ggnet2() to plot retweet_net:
    • Set the node.size to the centrality score, "cent".
    • Set the node.color to the community, "comm".
    • Set the color.palette to "Spectral".