Created
April 5, 2013 10:44
-
-
Save IanHopkinson/5318354 to your computer and use it in GitHub Desktop.
A gist in R showing how to plot twitter data from ScraperWiki as a smoothScatter plot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some experiments in R to handle twitter profile data | |
# Ian Hopkinson 2013-03-28 | |
# First we get the data in JSON format and then convert to a data.frame | |
library(rjson) | |
TwitterRecordsFile = 'http://box.scraperwiki.com/bdaw7xa/a6e8e71d96b2449/sql?q=select+*+from+twitter_followers' | |
TwitterRecords = fromJSON(file=TwitterRecordsFile, method='C') | |
Twitterdf=data.frame(t(sapply(TwitterRecords,c))) | |
# smoothScatter is in base R | |
smoothScatter(Twitterdf$followers_count,Twitterdf$following_count,xlim=c(0,5000),ylim=c(0,5000),main="Followers vs following count for a subset of twitter users") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment