Session Ready
Exercise

Visualize word networks

Another way to view word connections is to treat them as a network, similar to a social network. Word networks show term association and cohesion. A word of caution: these visuals can become very dense and hard to interpret visually.

In a network graph, the circles are called nodes and represent individual terms, while the lines connecting the circles are called edges and represent the connections between the terms.

For the over-caffeinated text miner, qdap provides a shortcut for making word networks. The word_network_plot() and word_associate() functions both make word networks easy!

The sample code constructs a word network for words associated with "Marvin".

Instructions
100 XP

Update the word_associate() plotting code to work with the coffee data.

  • Change the vector to coffee_tweets$text.
  • Change the match string to "barista".
  • Change "chardonnay" to "coffee" in the stopwords too.
  • Change the title to "Barista Coffee Tweet Associations" in the sample code for the plot.