Inspecting American Inaugural Addresses with Perl and R

Given all the inaugural  addresses of American presidents, what are the readability stats?  What is the sentiment over time?

UPDATE: Results charted for 2017

As usual I reach for perl to acquire and format the data for exploration with R.  The code below (and available on github) reads and analyzes a collection of text documents.  It then prints out the results found in a tab-delimited format for consumption with R.

So given a folder of inaugural addresses, I type this into the console:

In R, we read-in this data as so:

Mostly, I just want to plot the measures over time to see if there is an upward or downward trend.  Here is the code I made for this:

In the word and char plots, we see that the speeches have slowly said less, but that the number of sentences used has increased.  Also of note is that the grade-level readability has dropped dramatically.  Here are the plots:





So what about the emotional sentiment over time?  There is a fabulous R package for this!

With this function in place, we can process each address into plots.

Here are a few of the “emotional sentiment over time” plots:

1789-washington 1805-jefferson 1861-lincoln 1973-nixon 1981-reagan





Most all addresses end on an upward trending note.