Chapter 7 Retweets

Thus far we built graphs that link the user tweeting to the users he or she @tags in his or her tweets. This type of network, in essence, visualise how people discuss certain issues. We can build another graph, linking users to the users they retweet to fundamentally visualise how information spreads throughout Twitter.

7.1 Collect

We will run a slightly different query to collect tweets. Since we want to focus on re-tweets let’s ensure the tweets we collect include re-tweets.

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

7.2 Build

In previous graphs we set target = mentions_screen_name, the only difference this time is that we pass target = retweet_screen_name.

7.3 Visualise

Regarding the visualisation not much changes. We have the nodes and edges as returned by graphTweets, now we just need to pipe them through our sigmajs functions to build up the visualisation.

## Found # 64 clusters

So, based on the retweet networks, the larger nodes, that are relatively closer to the center of the graph (centrality measure) are relatively more important to spreading the topic we searched: #rstats.