What is #YoSoy132
On the last couple of months students in Mexico have held protests against the elected president Enrique Peña Nieto. Their movement is called #YoSoy132. I am still wondering what the movement is about… On the one hand, they were related to another presidential candidate Andres Manuel Lopez Obrador. On the other, they claim autonomy and in the pursue of a fair and clean elections (besides freedom of speech). Due to my curiosity, I did this wordcloud using R to extract the latest 1,500 tweets with the hashtag #YoSoy132 as of July 29th 2012 and map them using the ManyEyes visualization tool from IBM. Unfortunately, this does not give any insight about the movement.
[sourcecode language=”r”]
#Load Package
library(twitteR)
#get the 1,500 most recent tweets mentioning @WorldBank
yoSoy.tweets = searchTwitter(‘#YoSoy132’, n=1500)
length(yoSoy.tweets)
class(yoSoy.tweets)
tweet =yoSoy.tweets[[1]]
class(tweet)
#?status #describes some accessor methods
tweet$getScreenName()
tweet$getText()
#R has several ways to apply functionss iteratively, The plyr package unifies them all with a consistent naming ocnvention. The function name is determined by the input and output data types. We hace a list and would like a simply array output, so we use laply
library(plyr)
yoSoy.text = laply(yoSoy.tweets, function(t) t$getText())
length(yoSoy.text)
head(yoSoy.text,5)
yoSoy.text #Print results
[/sourcecode]