Ever wondered which Twitterers you and a friend share? Using R and the twitteR package, there’s an easy way to find out. Cornelius Puschmann hacked together some R code to do just that for the Humanities and Technology Camp and it seems to work pretty well. Just replace ‘coffee001’ with the your Twitter username, ‘mypassword’ with your Twitter password, and ‘Cornelius’ with your friend’s Twitter name, and the code does the rest. The only problem I had was that my graph was very cluttered, and despite the comments indicating you can set n to a smaller number, it didn’t work for me. (The code is very clearly commented, by the way.) I had to add the following two lines to make a readable chart:
friends.object <- friends.object[1:25]
followers.object <- followers.object[1:25]
The chart of followers I (@revodavid) share with the RevolutionR twitter account is below.
Although to be honest, looking at the chart now, I’m not actually sure this is our shared followers. I’ll have to look at the code more closely to figure out what’s going on; in any case it’s a neat example of integrating R with the Twitter API.
Cornelius Puschmann’s Blog: Code and brief instruction for graphing Twitter with R