For the last several months I have followed 11 different sports news sources on Twitter. Other than my love of sports, my objective in doing this has been to characterize these sports news sources in a variety of ways using R and the twitteR package. Below is a graphic of the 11 sports news sources I chose to analyze, along with their popularity as measured by number of followers.
The two ESPN sources “espn” and “SportsCenter” clearly dominate the field, with Sports Illustrated’s “SInow” coming in a distant third. The Twitter popularity of the ESPN news sources is no doubt a consequence of the leading role of ESPN in the televised delivery of sports, but I wonder if the ESPN Twitter feeds are actually superior to the other Twitter feeds as news sources.
What do you think?
#This code ONLY works once you have authenticated with Twitter
#See twitteR documentation for more details on authenticating
#Specify Twitter screen names
users<-lookupUsers(c('espn', 'Sinow', 'BleacherReport',
'FOXSports', 'YahooSports', 'SportsCenter', 'USATODAYsports',
'CBSSports', 'sportingnews', 'Deadspin', 'NBCSports'))
#Function to put user data into a data.frame for plotting
users.to.df<-function(x){
u.df<-data.frame(matrix(nrow=length(x), ncol=16))
for(i in 1:length(x)){
u.df[i,]<-x[[i]]$toDataFrame()
}
names(u.df)<-c("description", "statusesCount", "followersCount",
"favoritesCount", "friendsCount", "url", "name", "created",
"protected", "verified", "screenName", "location", "id",
"listedCount", "followRequestSent", "profileImageUrl")
u.df$screenName<-names(x)
return(u.df)
}
users.df<-users.to.df(users)
#Reorder factor levels for plotting followers in decreasing order
users.df<-users.df[order(-users.df[,3]),]
users.df$screenName<-factor(users.df$screenName,levels=users.df$screenName)
#Plot counts of Twitter followers
library(ggplot2)
ggplot(users.df,aes(screenName,followersCount)) +
geom_bar(stat="identity",fill="#253494") +
xlab("") + ylab("Followers") + theme_bw() +
theme(axis.text.x=element_text(angle=45,hjust=1,size=13)) +
theme(axis.title.y=element_text(vjust=.25,size=14))