This code is based on this example

http://www.r-bloggers.com/sentiment-analysis-for-airlines-via-twitter/

 I have chosen the ranking of quality on living of different cities, which is edited by The economist. I have used the 10 first cities with the highest rank and the 10 last cities with the lowest rank.

I have gotten the sentiment analysis from twitter about these cities and then I have matched and compared the results with R.