For this case study, we will take a look at president Obama's State of the Union speeches. I have no agenda here; just curious as to what can be uncovered in particular and if and how his message changed over time. Perhaps this will serve as a blueprint to analyze any politician's speech in order to prepare an opposing candidate in a debate or speech of their own. If not, so be it.
The two main analytical goals are to build topic models on the six State of the Union speeches and then compare the first speech in 2010 and the last in January, 2016 for sentence-based textual measures, such as sentiment and dispersion.
The primary package that we will use is tm
, the text mining package. We will also need SnowballC
for the stemming of the words, RColorBrewer
for the color palettes in wordclouds
, and the wordcloud
package. Please ensure that you have these packages installed before attempting to load them:
> library(tm) > library(wordcloud...