A wordcloud comparison of the 2011 and 2012 #SOTU

I wrote a quick (and very dirty) R script for creating a comparison cloud and a commonality cloud for President Obama’s 2011 and 2012 State of the Union speeches*. The cloud on the left shows words that have different frequencies between the two speeches and the cloud on the right shows the words in common between the two speeches. Here is a higher resolution version. 

The focus on jobs hasn’t changed much. But it is interesting how the 2012 speech seems to focus more on practical issues (tax, pay, manufacturing, oil) versus more emotional issues in 2011 (future, schools, laughter, success, dream). 

*The wordcloud R package does all the heavy lifting.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.
  • Rohit Malshe

    I got a few errors while running this. Could you tell me what may be going wrong?
    > term.matrix term.matrix colnames(term.matrix) <- c("SOTU 2011","SOTU 2012")

    Error in colnames(term.matrix) png(file="sotu2011vs2012.png",height=600,width=1200)

    > par(mfrow=c(1,2))

    > comparison.cloud(term.matrix,max.words=300,random.order=FALSE,colors=c("#1F497D","#C0504D"),main="Differences Between SOTU 2011/2012")

    Error in ncol(term.matrix) : object 'term.matrix' not found

    > commonality.cloud(term.matrix,random.order=FALSE,color="#F79646")

    Error in ncol(term.matrix) : object 'term.matrix' not found

    > dev.off()

    null device