State of the Union Addresses

Source Notebook

Complete text of State of the Union addresses from 1790 to 2024

Originator: Brad Borevitz

Details

This dataset contains every State of the Union address from 1790 to 2024 in plain text format, with dates for each speech, overall and individual word counts, and information about the political party and age of each president as of the date of the speech.

Examples

Basic Examples (1) 

Retrieve the default content:

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)]
Out[1]=

Visualization (7) 

Find the longest speeches:

In[2]:=
ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)][SortBy[#Words &]][
  All, {"President", "Year", "Words"}] // Reverse
Out[2]=

Show word counts over time:

In[3]:=
DateListPlot[ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)][All, {"Date", "Words"}], PlotRange -> All]
Out[3]=

Compare word counts for Democratic and Republican presidents:

In[4]:=
With[{partyDates = GroupBy[ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)], #Party &][All, All, {"Date", "Words"}]}, DateListPlot[{Normal@partyDates["Democratic"], Normal@partyDates["Republican"]}, Joined -> False, Filling -> Bottom, PlotLegends -> {"Democratic", "Republican"}]]
Out[4]=

Show a distribution of word counts by political party:

In[5]:=
partyCounts = GroupBy[ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)], #Party &][All, All, "Words"]
Histogram[partyCounts, ChartLayout -> "Stacked", ChartLegends -> Automatic]
Out[5]=
Out[6]=

Plot median speech lengths by political party:

In[7]:=
BarChart[Median /@ GroupBy[ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)], "Party"][All, All, "Words"], BarOrigin -> Left, ChartLabels -> Automatic]
Out[7]=

Show the frequency of specific words over time:

In[8]:=
Manipulate[DateListPlot[ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)][All, {#Date, #WordCounts[ToString[word]]} &], Joined -> False, Filling -> Bottom], {word, union}]
Out[8]=
In[9]:=
ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)][All, {#Date, #WordCounts[ToString[word]]} &]
Out[9]=

Generate a word cloud of a single president's speeches:

In[10]:=
WordCloud[StringJoin@Normal@ResourceData[\!\(\*
TagBox["\"\<State of the Union Addresses\>\"",
#& ,
BoxID -> "ResourceTag-State of the Union Addresses-Input",
AutoDelete->True]\)][
     Select[#President == Entity["Person", "FranklinDRoosevelt::xj8jv"] &]][All, "Text"], IgnoreCase -> True]
Out[10]=

Wolfram Research, "State of the Union Addresses" from the Wolfram Data Repository (2024)   https://doi.org/10.24097/wolfram.05676.data

Data Resource History

Source Metadata

Publisher Information