library(genius)
library(tibble)
library(tidyverse)
## ── Attaching packages ────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.2 ✓ dplyr 1.0.2
## ✓ tidyr 1.1.1 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.5.0
## ✓ purrr 0.3.4
## ── Conflicts ───────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(dplyr)
library(tidytext)
library(ggplot2)
Kanye West and Travis Scott are two very successful rappers. Travis Scott recently did A huge collaboration with McDonalds, the only other person to do a colloboration with McDonals similar to this was Micheal Jordans in 1992. Additionally these two artists both entered relationships and had children with members on the Kardashian/Jenner family Kanye West with Kim Kardashian and Travis Scott with Kylie Jenner. For this project I wanted to look at the sentiment of their albums to see how they change over time I predict Travis Scott will have more a negative sentiment and be agreesive in the middle of his career For Kanye I predict he will have more of a neutral/negative sentiment and be sad in the middle of his career as he talks about heartbreak The reason I choose the albums that I did was that I didn’t want to choose an album full of collaborations so I didn’t have a lot of Travis Scott albums left so I only choose the 5 Kanye albums that are the most important and have had a big impact on society like each of Travis’ albums have done I conducted a sentiment analysis using the NRC word-emotion association lexicon which can be found here: http://saifmohammad.com/WebPages/NRC-Emotion-Lexicon.htm This lexicon looks at all the words and judges whether they are positive or negative and what emotions they are
I started by gathering all the albums
rodeo <- genius_album(artist="Travis Scott", album="Rodeo")
## Joining, by = c("album_name", "track_n", "track_url")
birds <- genius_album(artist="Travis Scott", album="Birds in the trap sing Mcknight")
## Joining, by = c("album_name", "track_n", "track_url")
astroworld <- genius_album(artist="travis scott", album="astroworld")
## Joining, by = c("album_name", "track_n", "track_url")
days <- genius_album(artist="travis scott", album="days before rodeo")
## Joining, by = c("album_name", "track_n", "track_url")
owl <- genius_album(artist="travis scott", album="owl pharaoh")
## Joining, by = c("album_name", "track_n", "track_url")
graduation <- genius_album(artist="kanye west", album="graduation")
## Joining, by = c("album_name", "track_n", "track_url")
fantasy <- genius_album(artist="kanye west", album="My Beautiful Dark Twisted Fantasy")
## Joining, by = c("album_name", "track_n", "track_url")
pablo <- genius_album(artist="kanye west", album="The life of pablo")
## Joining, by = c("album_name", "track_n", "track_url")
Yeezus <- genius_album(artist="kanye west", album="yeezus")
## Joining, by = c("album_name", "track_n", "track_url")
heartbreak <- genius_album(artist="kanye west", album="808s heartbreak")
## Joining, by = c("album_name", "track_n", "track_url")
I then did sentiment analysis on all the albums to help compare them
Here is an example of my code for one album
rodeo %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("nrc")) -> rodeotwo
## Joining, by = "word"
## Joining, by = "word"
Bar graphs:
I used this website for help with the barplots, http://www.sthda.com/english/wiki/ggplot2-barplots-quick-start-guide-r-software-and-data-visualization
1st comparision Owl Paraoh vs graduation
ggplot(data=owltwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Owl Paraoh by Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data=graduationtwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Graduation by Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
In the first album I compared we found out Travis Scott was much more negative then Kanye West Travis’ main emotions were anger and distrust while Kanye’s was anger and trust Overall Kanye’s album had a lot of positivity to it
2nd Comparrison Days Before Rodeo vs 808s & heartbreak
ggplot(data=daystwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Days Before Rodeo by Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data=heartbreaktwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of 808s & heartbreak by Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
In this second album comparrison Kanye’s was a lot more emotional and Travis was just more angry Kanye had more positivity then negativity and his most popular emotions were joy and sadness Travis Scott was a very negative on this album, he has more anger words then positive words Travis’s main two emotions were anger and disgust
3rd Comparrison My Beautiful Dark Twisted Fantasy vs Rodeo
ggplot(data=fantasytwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of My Beautiful Dark Twisted Fantasy by Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data=rodeotwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Rodeo by Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
In this comparrison the two artists are more similar then they have been before They have similar levels of negativity and positivity. Travis main sentiments this album were anger, fear, and trust while Kanye’s sentiments were more anger and disgust and his positivity level is dropping
4th Comparrison Birds in the Trap Sing McKight
ggplot(data=birdstwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Birds In The Trap Sing Mcknight by Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data=Yeezustwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Yeezus by Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
Compared to previous albums Travis is more positive on this album and Kanye is more negative Travis’ most popular sentiment was trust followed by surprise Kanye’s main sentiments were anger and fear
5th comparrison
ggplot(data=astroworldtwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Astroworld by Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data=pablotwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of Life of Pablo by Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
In this final album comparrison we are seeing much closer negative and positive levels Both Kanye and Scott were more postive then negative on their albums Kanye overall sang more about trust and joyful things and scott sang about fear and anger
Final data comparrison
ggplot(data= scott_lyricstwo, aes(x=sentiment, y=n, fill=sentiment)) +
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of all Travis Scott") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
ggplot(data= west_lyricstwo, aes(x=sentiment, y=n, fill=sentiment))+
geom_bar(stat="identity")+
scale_fill_hue(c = 60) +
ggtitle("Sentiment analysis of all Kanye West") +
xlab("Emotions") + ylab("Frequency")+
theme(legend.position="none")
scott_lyrics %>%
unnest_tokens(word, lyric) %>%
count(word, sort = TRUE) -> scott_words
sum(scott_words$n)
## [1] 36934
Across all his albums Travis Scott sang 30797 words
west_lyrics %>%
unnest_tokens(word, lyric) %>%
count(word, sort = TRUE) -> west_words
sum(west_words$n)
## [1] 35027
Across these albums Kanye West sang 35097 which is 4,300 more then Travis Scott
In a final comparison between the two it seems the two artists have pretty similar sentiment values for most emotions, looking at anger and joy specifically I found out that Travis Scott is a lot more of a negative rapper then Kanye west Kanye sings less about anger topics and more about topics joyful topics Travis Likes to sing with more angry sentiments which is not something I thought about In their last albums both rappers have high levels of positivity This could potentially show how entering relationships with Kardashians could increase how positive someone is or how positive they sing because Travis Scott entered his relationship with Kylie Jenner a year before releasing his album, Astroworld. and Kanye West had his first kid with Kim Kardashian a year prior to releasing The Life of Pablo