Three hours of pure soccer emotion, visualized with R

July 6, 2012

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

The biggest prize in UK soccer, the Premier League Championship, is decided by a points system. Unlike most sports competitions, there's no final round or playoff series: once the regular round of games is complete, the team that has accumulated the most points (three for a win, and one for a draw) is the champion of English football. In the event of a tie in points, the winner is decided by goal difference (total goals scored minus total goals conceded), and then by total goals scored. 

The last games of the 2011-2012 season were played nearly simultanously on May 13. The two condenders for the title were the Manchester City and Manchester United teams, each playing in separate games. To win the title, Manchester United needed to win their game and for Manchester City to lose theirs. The United game finished their match first with the title seemingly in the bag, until an injury-time goal at the other game took City to an historic championship victory.

As you can imagine, for players watching at home it was a tense experience, with the final minutes of both games being displayed split-screen. For the fans at the United game, it was a surreal experience, with the local play over but the ultimate result being decided hundreds of miles away. At the UseR 2012 conference last month, Przemyslaw Biecek showed how he used the R language to perform sentiment analysis on tweets captured the game and stored in the IBM Netezza data warehousing appliance to capture that emotion in the data visualization below (click to enlarge):

Premier Emotions League

Check out the middle panel in particular: the blue line is the sentiment of Man City fans (higher is more positive) and the red that of Man United fans, where you can see the transition from elation to crushing disappointment at 5:47 PM.

For complete details of the analysis, check out Przemyslaw's post at IBM developerWorks below.

IBM Developerworks: Premier Emotions League: title fight Twitter visualization in R 

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training




CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)