Occupy Wall St hashtag word cloud
 
This word cloud was generated from the hashtags of 156 different Occupy movement Twitter feeds from the month of December. What is interesting is the prominent presence of #SOPA and #NDAA -- both political issues which were not necessarily associated with inequality. Did this change of message have any impact? I’m not sure. On the other hand, it’s a pretty picture! The R code to generate this is (adapted from http://onertipaday.blogspot.com/2011/07/word-cloud-in-r.html):

library(tm)
library(wordcloud)
library(RColorBrewer)

hts_dec <- paste(corpus_big$V6[corpus_big$V4=="Dec"], collapse=" ") #character vector of all hashtags from December

hts_dec_c <- Corpus(VectorSource(hts_dec)) #use TM library to tun this into a “Corpus”

tdm_hts_dec <- TermDocumentMatrix(hts_dec_c) #use TM library to turn Corpus into a Term-Document Matrix

m <- as.matrix(tdm_hts_dec) #Remove the TM formatting

v <- sort(rowSums(m),decreasing=TRUE) #get the frequencies

d <- data.frame(word = names(v),freq=v) #make a dataframe of words and their frequencies

pal2 <- brewer.pal(8,"Dark2") #set the colors

pdf("/users/tesswise/Desktop/Classes Fall 2011/Gov 2002/Occupy Project/hashtags_dec.pdf", width=11, height=11)
wordcloud(d$word,d$freq, scale=c(8,.2), min.freq=3, max.words=Inf, random.order=FALSE, rot.per=.15, colors=pal2, random.color=TRUE)
dev.off()http://onertipaday.blogspot.com/2011/07/word-cloud-in-r.htmlshapeimage_1_link_0
Wednesday, February 8, 2012