Chapter 9 Co-mentions

The twinetverse also enables building networks of co-mentions. Say, instead of connecting users posting tweets to the @users they tag in their tweets or the #hashtags they mention in their tweets, we were to connect the #hashtags or the @users mentioned in the tweets to each other, not taking into account the person posting the tweet.

Let’s collect some tweets for this chapter.

## Searching for tweets...
## Finished collecting tweets!

9.1 Users

Building graphs of co-mentions requires the use of another function, from the graphTweets package. Instead of using gt_edges we use gt_co_edges, simple enough. Moreover since we ignore the source of the tweets, we only have to pass one argument to the function, the column containing the variable of which we want to to graph the co-mentions; hashtags, or mentions_screen_name.

Since we are going to graph more than one co-mention network, let’s define a graph function that we can easily re-use.

## Found # 70 clusters

9.2 Hastags

Now let’s do the same as we did in the previous section but using #hashtags, make the graph and plot the result.

## Found # 39 clusters

It’s obviously not as informative as the previous graph we made, there is a simple reason. Since we got tweets on #rstats all hashtags co-mention #rstats and are thus connected to it on the graph. This is a known piece of information and clutters the graph, let’s remove it.

Now that the filtering is done we can plot the data.

Remember to filter both edges and nodes.

## Found # 124 clusters