Background

In 2006, the world watched as 13 year old Miley Cyrus catapulted to international stardom through her role as a teen pop sensation living a double life on Disney’s “Hannah Montana”. Miley spent 5 years donning her Hannah wig, but along the way she started to develop her own personal identity as an artist. For this report, I was interested in trying to understand the evolution of Miley as an artist. As the image below demonstrates, Miley has really changed over the years and her music reflects this. I wanted to see how her lyrics changed, how the sentiment of her albums progressed, and how her use of profanity evolved as she developed into the artist she is today. I am hypothesizing that Miley’s newer work will have a more negative sentiment and include more profanity than her older albums.

Miley has released 5 studio albums and these are what are being analyzed in this report: Breakout (2008), Can’t Be Tamed (2010),Bangerz (2013),Miley Cyrus & Her Dead Petz (2015) and Younger Now (2017).

Process

This report was created using R Studio and published using R Markdown. To get the lyrics from each of Miley’s albums, Josiah Parry’s genius package was downloaded from GitHub. Other packages needed for this project include tidytext, tidyverse, wordcloud2, ggplot2 and ggthemes.

Lyrics Analysis

To begin my analysis of Miley’s evolution, I decided to look at how her lyrics changed as her albums progressed. To do this, I looked at the top 15 words in each of her albums and the number of times she used each.

I began by getting the lyrics with the genius package and then unnesting the tokens and removing stopwords (words such as “an”, “a”, “any”). I then further filtered the results to exclude “la”, “da” and “ooh”, as Miley uses these sounds frequently in her songs but they contain no real meaning and are therefore not helpful in our analysis.

breakout <- genius_album(artist= "Miley Cyrus", album="Breakout")

breakout %>%  unnest_tokens(word, lyric) %>% 
  anti_join(stop_words) %>% 
  count(word,sort=TRUE) -> breakoutCount

breakoutCount %>% 
  filter(!word %in% c("la", "da", "ooh")) -> breakoutCountFiltered

breakoutCountFiltered %>%
  head(15) -> breakoutSorted

I then used ggplot in order to display the top 15 songs in each album:

ggplot(breakoutSorted, aes(reorder(word, n), n)) +geom_col(fill="purple") +ylab("Count") +xlab("Word") +ggtitle("Most Popular Words in Breakout") + coord_flip() +theme_minimal()-> breakoutCountPlot1

breakoutCountPlot1 + theme(axis.text.x=element_text(angle=45, hjust=1))

Breakout is Miley’s first album that is unaffiliated with Hannah Montana, and in general the album received good reviews from critics. Her vocal talent was not denied, but some critics argued that it was not far enough a departure from her Hannah Montana persona. The two most popular words in this album are “wanna” and “gonna”, alluding to Miley’s “I’ll do what I want” attitude and her independence from her Disney role.

In Miley’s second studio album “love”, “heart”, and “rose” all find their way into the top 15 words, suggesting romance plays a bigger influence in this album. This is a theme that runs consistently throughout her other albums after this point.

This is the first album released after Hannah Montana went off air and it is often noted as a tipping point in Miley’s career and image, signifying her complete shift from Disney’s Hannah to Miley. Several slang words are within the the top 15 words on the album, like “i’ma”, “thang”, and “struttin”, demonstrating a stylistic change in Miley’s music. We also see the emergence of more mature themes in this album, showcased by the popularity of words like “party”, “money” and “night” in the lyrics.

This album created independently from Miley’s label, and features some of Miley’s most critiqued work to this day. Pitchfork says the album is “an indulgent collection of experiments that exist for no other reason than because they can”, and this really speaks to the seeming randomness of the album. One trend that sticks out on this album is the repetitive nature of the lyrics. Of the 15 most popular songs, almost all of them are repeated more than 20 times, and most close to or above 30. This is also the first time we see curse words in the top 15 words on one of Miley’s album. “Milky”, a slang term that references filling a bong with so much smoke it looks like milk, is repeated 23 times throughout the album, and its prevalence speaks to the type of content that much of her lyrics refer to on this album.

With this album we see Miley return to her more signature style, with the drug references and curse words being less prevalent and not found within the top 15 most popular words. The most popular words speak to the emotional tone of the album, with words like “love”, “mood”, “miss”, “touch”, “feel”, and “thinkin” all within the top 15.

Additionally, I created word clouds as an additional way to visualize the most popular words in each of her albums. The bigger a word appears in the word cloud, the higher its frequency in the album. These word clouds are a fun way to see the progression of Miley’s lyrical style throughout her albums, and they provide a broader look at the lyrics in each album than the charts above.

wordcloud2(breakoutCountFiltered, color="random-light", backgroundColor="grey", size = 2, minRotation = -pi/2, maxRotation = -pi/2)

Breakout

Can’t Be Tamed

Bangerz

Miley Cyrus & Her Dead Petz

Younger Now

Miley’s Use of Profanity

One particular aspect of Miley’s musical evolution I was interested in looking at was her use of profanity in her songs. I hypothesized that her use of profanity would increase with each of her albums as she shed her Disney image. I analyzed her use of the seven most popular curse words in the English language, according to Scribendi. I created a curse words variable, turned it into a dataframe, and then used it to filter each of the word count variables from her albums to create curse count variables for each album.

curse_words <- c("shit", "piss", "ass", "hell", "damn", "bitch", "fuck")
curse_words <- data_frame(word = curse_words)

breakoutCurseCount <- breakoutCount %>% filter(word %in% curse_words$word)
breakoutCurseCount["album"] <- "Breakout"

I then performed an rbind of all the curse count variables and used ggplot in order to visualize Miley’s use of curse words.

curseCounts <- rbind(breakoutCurseCount, tamedCurseCount, bangerzCurseCount, deadpetzCurseCount, youngernowCurseCount)

ggplot(curseCounts, aes(album,n,fill=word)) + geom_bar(stat="identity") + ylab("Count") +xlab("Album") +ggtitle("How much does Miley curse?") + coord_flip() + theme_minimal()

The results were pretty similar to what I was expecting, with Miley’s use of curse words progressively getting more frequent. However her newest album, Younger Now, deviates from that trend and has fewer of these 7 curse words in its lyrics than the two albums prior to it. “Miley Cyrus and Her Dead Petz” has the highest frequency of these 7 curse words by far, but Bangerz has the most diverse assortment of curse words, with all 7 of the most popular curse words featured in its lyrics. Miley didn’t use any of those curse words in “Breakout”, and only uses “hell” twice in “Can’t Be Tamed”, her two earliest albums.

Album Sentiment Analysis

As the next part of my analysis, I wanted to look at how the sentiment of Miley’s albums has progressed. To do this, I used the afinn sentiment scale. This scale assigns a score to each of the words within its lexicon, ranging from -5 to 5. Negative scores indicate the word has a negative sentiment and positive scores indicate the word has a positive sentiment.

I began by performing an innerjoin of the afinn sentiment scale with the words from each album. I wanted to ensure that the frequency of words was taken into account in the score, so I created a new variable with an additional column that multiplied the score of the word and the number of times it was used. Using this total column, I found the average sentiment score for each album.

BreakoutSentAfinn <- breakoutCountFiltered %>%
  inner_join(get_sentiments("afinn")) %>%
  ungroup()

BreakoutSentAfinn

BreakoutSentAfinn2 <- BreakoutSentAfinn %>% mutate(total = n * score)

BreakoutSentAfinn2

mean(BreakoutSentAfinn2$total) -> BreakoutSentAfinn3
BreakoutSentAfinn3

BreakoutAfinnScore=1.057143

Once I had the average sentiment score for each album, I created a new dataframe that included the album title and their corresponding score and then used ggplot to create the visualization.

Score = c(1.057143, -0.617284, 0.946286, -2.415929,.01470588)

Album = c("aBreakout", "bCan't Be Tamed","cBangerz", "dMiley Cyrus & her Dead Petz", "eYounger Now")

AFinnData <- data.frame(Album, Score)

AFinnChart <- AFinnData %>%
  ggplot(aes(x = Album, y = Score, fill = Score)) + geom_col(show.legend = FALSE, fill="purple") +
  ggtitle("Afinn Positivity Score per Album") + ylim(-2.5, 2) + xlab("Album") +
  theme_minimal()+
  ylab("Score") +
  xlab("Album")

AFinnChart + theme(axis.text.x=element_text(angle=45, hjust=1))

The results were pretty similar to what I was expecting, with “Breakout”, Miley’s first studio album, having the highest average sentiment score and her later albums having lower sentiment scores. Unsurprisingly, “Miley Cyrus & Her Dead Petz” had the lowest average sentiment score. As described above, this album also had the highest frequency of curse words which probably contributed to this low score. I was surprised to see “Bangerz”, her third album have almost as positive a score as “Breakout”. One possible contributing factor could be the frequency of the use of the word “love” in this album. “Love” is sung 108 times in this album, and has a sentiment score of 3, so it had a large impact on the total score.

Conclusion

Miley’s musical style has definitely evolved over the years, growing and maturing along with her. My hypothesis was partially correct, with her use of profanity increasing as time progressed,but the sentiment change in her albums was not as significant as I would have thought, with two of her later albums, “Bangerz” and Younger Now” both having positive sentiment scores. An interesting takeaway from this analysis is that “Miley Cyrus & Her Dead Petz” seems to be a significant departure from the rest of her work, having the highest use of profanity and the lowest average sentiment score. It represents Mileys experimental nature as an artist, and leads me to believe she’s still trying to find her own style. I would be interested in continuing this analysis when she releases more albums in the future, and seeing if she settles into a more consistent pattern or if she keeps experimenting.