Hamilton the Musical Lyric Analysis

This report analyzes the lyrics of Hamilton the Musical. Hamilton is a groundbreaking show as it tells the story of the American Revolution and the founding father Alexander Hamilton in rap and hip hop. The show premiered at the Public Theatre in 2015 and was an instant sensation receiving 11 Tony awards at the 2016 Tony Awards. The entire show is music, so the soundtrack is what you would hear if you saw this show in person. This report will compare the lyrics of act 1 and act 2 and how they differ and then dive deeper into looking at songs that only feature one character. The first act centers around the Revolution and how Hamilton made a name for himself and made connections with important people in American history. Act 2 dives deeper into Hamilton’s personal life and how he can use his contacts and prestige to make a difference in our government.

Here is the wikipedia page to read more about Hamilton!

Required Libraries

library(tidyverse)
library(tidytext)
library(textdata)
library(genius)
library(dbplyr)
library(stringr)
library(wordcloud2)
library(ggplot2)
library(htmlwidgets)
library(webshot)
library(ggthemes)

First I loaded the entire Hamilton album from the Genius program. This will give me access to all the songs in the cast recording.

hamilton <- genius_album("Lin-Manuel Miranda", "Hamilton: An American Musical (Original Broadway Cast Recording")

First we can look at how many words are in Hamilton in total. To understand how many words we are looking at.

Let’s Count All Words

hamilton %>% 
  unnest_tokens(word,lyric)->ham_words

ham_words %>% 
  count()
## # A tibble: 1 x 1
##       n
##   <int>
## 1 21119

Lin- Manuel Miranda writes wordy musicals. “Hamilton”, has 21119 words crammed into two and a half hours of entertainment. I then looked at all of the words in the musical and wanted to see what were the most popular words. A filter was put into place to narrow down some of the words to make a more readable graph.

I filtered out several words throughout my analysis that were common and not filtered out as stop words. I felt like these words interfered with the essential words. I included these exclusions in my entire show and act by act analysis. Some of the common words I saw that were not significant were:

‘ya’, ‘dat’, ‘em’ and ‘da’

I also filtered out names that came up in the analysis frequently, such as:

“alexander”,‘hamilton’,‘thomas’,‘madison’,‘john’,‘george’,‘eliza’,‘adams’,‘angelica’,‘washington’,‘jefferson’,‘burr’

These names are the leads in the show and are mentioned frequently, so there was no reason to analyze their appearance.

Most Common Words

ham_words %>% 
  anti_join(stop_words) %>% 
  group_by(word) %>% 
  filter(!word %in% c('da','dat' ,'em', 'hamilton','alexander','yo', 'thomas','hey','madison','john','george' , 'eliza','adams','angelica', 'washington', 'jefferson','burr', 'sir', 'gon')) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  filter(n>30) 
## # A tibble: 14 x 2
## # Groups:   word [14]
##    word          n
##    <chr>     <int>
##  1 wait         81
##  2 time         79
##  3 shot         58
##  4 whoa         42
##  5 gonna        38
##  6 president    38
##  7 rise         37
##  8 world        36
##  9 satisfied    35
## 10 story        35
## 11 alive        34
## 12 york         33
## 13 helpless     32
## 14 home         32

I then divided the show into acts and loaded each song to analyze the lyrics. The first act has 23 songs. I then used ‘unnest_tokens’ to separate out the phrases into words.

ACT 1

act1 <- tribble(
  ~ artist, ~ title,
  "Lin-Manuel Miranda", "Alexander Hamilton",
  "Lin-Manuel Miranda", "Aaron Burr, Sir",
  "Lin-Manuel Miranda", "My Shot", 
  "Lin-Manuel Miranda", "The Story of Tonight",
  "Lin-Manuel Miranda", "The Schuyler Sisters",
  "Lin-Manuel Miranda", "Farmer Refuted ",
  "Lin-Manuel Miranda", "You'll Be Back",
  "Lin-Manuel Miranda", "Right Hand Man", 
  "Lin-Manuel Miranda", "A Winter's Ball",
  "Lin-Manuel Miranda", "Helpless",
  "Lin-Manuel Miranda", "Satisfied", 
  "Lin-Manuel Miranda", "The Story of Tonight (Reprise)",
  "Lin-Manuel Miranda", "Wait For It",
  "Lin-Manuel Miranda", "Stay Alive", 
  "Lin-Manuel Miranda", "Ten Duel Commandments",
  "Lin-Manuel Miranda", "Meet Me Inside",
  "Lin-Manuel Miranda", "That Would Be Enough", 
  "Lin-Manuel Miranda", "Guns and Ships",
  "Lin-Manuel Miranda", "History Has Its Eyes on You", 
  "Lin-Manuel Miranda", "Yorktown (The World Turned Upside Down)",
  "Lin-Manuel Miranda", "What Comes Next? ", 
  "Lin-Manuel Miranda", "Dear Theodosia ",
  "Lin-Manuel Miranda", "Non-Stop ", 
)


act1_lyrics <- act1 %>% 
  add_genius(artist, title, type = "lyrics") %>% 
  unnest_tokens(word,lyric)

This graph shows the most common lyrics in act 1.

I added a filter of words that are spoken more than 11 times because with the nature of songs, words are repeated many times

Act 1 Most Common Words

act1_lyrics %>% 
  anti_join(stop_words) %>% 
  filter(!word %in% c('da','dat' ,'em', 'hamilton','alexander','yo', 'ya', 'thomas','hey','madison','john','george' , 'eliza','adams','angelica', 'washington', 'jefferson','burr', 'sir', 'gon')) %>% 
  group_by(word) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  filter(n>11) %>% 
  ggplot(aes(reorder(word, n), n, fill=word)) + geom_col() + coord_flip() + theme_solarized()

Word Cloud Act 1

For this wordcloud of the lyrics in Act 1 I took out the filter of words mentioned more than 11 times. So this shows all the most popular words throughout the act.

act1_lyrics %>% 
  anti_join(stop_words) %>% 
  filter(!word %in% c('da','dat' ,'em', 'hamilton','alexander','yo', 'ya', 'thomas','hey','madison','john','george' , 'eliza','adams','angelica', 'washington', 'jefferson','burr', 'sir', 'gon')) %>% 
  group_by(word) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  wordcloud2()

The most popular word in the act is “wait,” mentioned 57 times. From seeing the show several times and listening to the soundtrack too many times to count, I cannot think of another word to describe the entire act. You have to ‘wait’ and see how the story plays out. The first act plays the traditional role in a musical where the scene is set and the characters are introduced. In the first act, Hamilton builds up his reputation and creates lasting connections with other founding fathers and essential people in our country. The show also starts with giving away the ending because Burr shoots Alexander Hamilton in the end. You have to wait till the end to see how it plays out even though you know the outcome.

The second most popular word is ‘satisfied’ which plays to Hamilton’s interactions with the Schuyler sisters and how he, his wife Eliza, and her sister Angelica are never satisfied and always wanting more. This word may appear to make it seem like all the characters are at ease and are satisfied with their life, but almost every time this word is mentioned it is negated. “You will never be satisfied.”

ACT 2

act2 <- tribble(
  ~ artist, ~ title,
  "Lin-Manuel Miranda", "What'd I Miss",
  "Lin-Manuel Miranda", "Cabinet Battle #1",
  "Lin-Manuel Miranda", "Take a Break", 
  "Lin-Manuel Miranda", "Say No to This",
  "Lin-Manuel Miranda", "The Room Where It Happens",
  "Lin-Manuel Miranda", "Schuyler Defeated ",
  "Lin-Manuel Miranda", "Cabinet Battle #2 ",
  "Lin-Manuel Miranda", "Washington on Your Side", 
  "Lin-Manuel Miranda", "One Last Time",
  "Lin-Manuel Miranda", "I Know Him",
  "Lin-Manuel Miranda", "The Adams Administration", 
  "Lin-Manuel Miranda", "We Know",
  "Lin-Manuel Miranda", "Hurricane",
  "Lin-Manuel Miranda", "The Reynolds Pamphlet", 
  "Lin-Manuel Miranda", "Burn",
  "Lin-Manuel Miranda", "Blow Us All Away ",
  "Lin-Manuel Miranda", "Stay Alive (Reprise)", 
  "Lin-Manuel Miranda", "It's Quiet Uptown",
  "Lin-Manuel Miranda", "The Election of 1800", 
  "Lin-Manuel Miranda", "Your Obedient Servant",
  "Lin-Manuel Miranda", "Best of Wives and Best of Women ", 
  "Lin-Manuel Miranda", "Who Lives, Who Dies, Who Tells Your Story",
  "Lin-Manuel Miranda", "The World Was Wide Enough", 
)


act2_lyrics <- act2 %>% 
  add_genius(artist, title, type = "lyrics") %>% 
  unnest_tokens(word,lyric)
act2_lyrics %>% 
  anti_join(stop_words) %>% 
  filter(!word %in% c('da','dat' ,'em', 'wanna', 'hamilton', 'alexander', 'yo', 'ya','hey', 'thomas','john','george' ,'madison', 'eliza','adams','angelica', 'washington', 'jefferson','burr', 'sir', 'gon')) %>% 
  group_by(word) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  filter(n>10) %>% 
  ggplot(aes(reorder(word, n), n, fill=word)) + geom_col() + coord_flip() + theme_solarized()

WordCloud Act 2

This shows all words in act two without the filter.

act2_lyrics %>% 
  anti_join(stop_words) %>% 
  filter(!word %in% c('da','dat' ,'wanna', 'em', 'hamilton', 'alexander', 'yo', 'ya','hey', 'thomas','madison','john','george' , 'eliza','adams','angelica', 'washington', 'jefferson','burr', 'sir', 'gon')) %>% 
  group_by(word) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  wordcloud2()

In act 2, the most common word was “time,” which is a prominent motif in the show. The characters discuss how much time they have left and the mark they have left on the world. Time is said/ sung 41 times in the second act. “Who lives who dies who tells your story” is a big idea.

The word “time” also made the top 10 in the first act, coming in at number 4, and said a total of 26 times.

The second most mentioned word in act 2 is “president”. This act centers a lot around the presidency and who will take George Washington’s place when he steps down.

“wait” also comes up as a popular word in Act 2. While only mentioned about half the times,we as an audience are still waiting and in suspense in whats to come.

Solo Songs

In the musical Hamilton, the majority of songs are sung as a group, and it is unique when there is only one character on stage, having a piece to themselves. It would be interesting to show these few songs’ sentiments where you only hear from one perspective.

Eliza sings by herself after she discovers that her husband Hamilton was having an affair. The song “Burn” is sung in the middle of the second act and is one of the most emotional songs. Hamilton was discovered by his affairs husband, and in return for his secrecy had paid him off. Hamilton then had a big secret that he had to bring to the light of day before running for office to clear his name. Eliza says, “by clearing your name; you have ruined our lives.”

Eliza’s Words

eliza <- tribble(
  ~ artist, ~ title,
  "Lin-Manuel Miranda", "Burn"
)
eliza_lyrics <- eliza %>% 
  add_genius(artist, title, type = "lyrics") %>% 
  unnest_tokens(word,lyric)
eliza_lyrics %>% 
  anti_join(stop_words) %>% 
  group_by(word) %>% 
  count() %>% 
  arrange(desc(n)) %>% 
  wordcloud2()

Then looking at the sentiment of Eliza’s words the singular words have a lot of positive sentiment but the overall sentiment of the song is negative.

get_sentiments("afinn")
## # A tibble: 2,477 x 2
##    word       value
##    <chr>      <dbl>
##  1 abandon       -2
##  2 abandoned     -2
##  3 abandons      -2
##  4 abducted      -2
##  5 abduction     -2
##  6 abductions    -2
##  7 abhor         -3
##  8 abhorred      -3
##  9 abhorrent     -3
## 10 abhors        -3
## # … with 2,467 more rows
sent_eliza<- eliza_lyrics %>% 
  inner_join(get_sentiments("afinn"))

ggplot(sent_eliza, aes(word, value, fill = word)) +theme_solarized() +
  geom_col(show.legend = FALSE) 

King George’s Words

The King sings 3 songs by himself onstage, and although he is only onstage for 15 total minutes of the show he is a fan favorite. He shows up to mock the blooming American government and remind them that they can always come crawling back. I filtered out three words that I deemed insignificant because they were not words. I filtered out:

‘da’, ‘dat’, ‘ya’

king <- tribble(
  ~ artist, ~ title,
  "Lin-Manuel Miranda", "I Know Him",
  "Lin-Manuel Miranda", "What Comes Next? ",
  "Lin-Manuel Miranda", "You'll Be Back",
)

king_lyrics <- king %>% 
  add_genius(artist, title, type = "lyrics") %>% 
  unnest_tokens(word,lyric)
king_lyrics %>% 
  anti_join(stop_words) %>% 
  group_by(word) %>% 
  count() %>% 
  filter(!word %in% c('da', 'dat', 'ya' )) %>% 
  arrange(desc(n)) %>% 
  wordcloud2()
sent_king<- king_lyrics %>% 
  anti_join(stop_words) %>% 
  inner_join(get_sentiments("afinn"))

ggplot(sent_king, aes(word, value, fill = word)) +theme_solarized() +
  geom_col(show.legend = FALSE) 

Looking at the King’s sentiment he doesn’t have a strong positive or negative pull. I found it funny that his most said word was “love” which he uses as a joke when he says “I will send a fully armed battalion to remind you of my ‘love.’”

Conclusion

In summary we looked at the entire show of Hamilton, then broke it down into acts and then by character. This show has a lot of words packed into it and that is why I decided to analyze it for my project. I also think that the words are really intentional and there are a lot of double meanings hidden in the script. In the nature of music, words are repeated because they are in the chorus and words come up again in the reprises of songs. I feel like Hamilton has a lot of repeated themes like “wait for it” and "who lives who dies who tells your story.’

Hamilton the musical is a revolutionary piece that really stepped outside of the norm when it comes to theatre. The words chosen have many meanings and I would love to analyze this album further in the future, and I encourage everyone to listen to it if they have not!