This report is an exploration of growth for the artist Beyonce.

Warning: Explicit Content

Beyoncé Giselle Knowles-Carter is an American singer, songwriter, and actress who was born in Houston, Texas on September 4th, 1981. Beyoncé rose to fame in the late 1990s as the main vocalist of Destiny’s Child, one of the best-selling girl groups of the time. She is now one of the most globally well-known artists, and in 2014, she was awarded Forbes’ Most Powerful Celebrity.

I will be looking at how/if Beyoncé’s music is effected by events that occur in her life. I will be looking at her six main albums “Dangerously in Love (2003),”B’Day” (2006), “I AM… SASHA FIERCE” (2008), “4” (2011), “BEYONCÉ” (2014) and “Lemonade” (2016). I chose only to look at these works with the help of Wikipedia and Spotify. Spotify also recognizes “B’Day Deluxe Edition” (2007), “Above and Beyoncé Dance Mixes” (2009), “I Am…World Tour” (2010), “HOMECOMING: THE LIVE ALBUM” (2019), “The Lion King: The Gift” (2019), and “The Lion King: The Gift [Deluxe Edition]” (2020). I will look at the text within each of Beyonce’s albums to look at overall tone and sentiment. I will be looking at if the sentiment of the albums change and if there was any major life events going on at the time to cause this change. I will also be looking the chords, valence (joyfulness), and dancability of the albums to look for changes. I will be using both a lyrical data set from https://www.kaggle.com/datasets/deepshah16/song-lyrics-dataset, which was edited down in excel and then uploaded to R, and Spotify API to get my necessary information.

First I download the necessary packages

library("tidytext")
library("wordcloud2")
library("tidyverse")
## Warning: package 'tidyr' was built under R version 4.0.5
## Warning: package 'readr' was built under R version 4.0.5
library("tidyr")
library("readr")
library("rjson")
## Warning: package 'rjson' was built under R version 4.0.5
library(devtools)
devtools::install_github('charlie86/spotifyr')
devtools::install_github("lchiffon/wordcloud2")
library(spotifyr)
library(tidyverse)
library(knitr)
library(ggjoy)
library(ggridges)
library(dplyr)
library(plotly)
library(ggplot2)
library(ggthemes)
library(textdata)
library(jsonlite)
## Warning: package 'jsonlite' was built under R version 4.0.5
library(readxl)
library(fastmap)
Next I use my Spoitfy API access keys to download Beyonce Spotify data

Here I am going to download each individual album

“Dangerously In Love”

Dangerously In Love is the debut studio album by American singer Beyoncé. Columbia Records and Music World Entertainment released it on June 20, 2003. This album was released after Destiny’s Child revealed that they will make individual albums during the recording of their third studio album, Survivor.

Beyonce_DIL <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_DIL.xlsx")
View(Beyonce_DIL)

How many words are in this album

Beyonce_DIL %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1  8470

8470

How many times do the most popular words occur within the album?

Beyonce_DIL %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  head(10) %>%
  knitr::kable()
word n
love 136
baby 94
beyonc 52
boy 51
huh 49
time 48
crazy 44
girl 40
gonna 37
feel 35

What is the sentiment of these words?

Beyonce_DIL %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  head(10) %>%
  knitr::kable()
word n sentiment value
love 136 positive 3
crazy 44 negative -2
loving 17 positive 2
cancer 10 negative -1
damn 7 negative -4
sexy 7 positive 3
cry 6 negative -1
free 6 positive 1
hurt 6 negative -2
cool 5 positive 1

note –> interesting “crazy” is negative when in context it is supposed to be “crazy love” or “crazy in love”

What words stand out the most in a word cloud

Beyonce_DIL %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  wordcloud2()

“love”, “baby”, “crazy”

Looking at Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "Dangerously In Love") -> DILAlbum
View(DILAlbum)

Which track in Dangerously In Love has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "Dangerously In Love") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.646 Dangerously In Love Crazy In Love (feat. Jay-Z)
0.588 Dangerously In Love Naughty Girl
0.655 Dangerously In Love Baby Boy (feat. Sean Paul)
0.736 Dangerously In Love Hip Hop Star (feat. Big Boi & Sleepy Brown)
0.711 Dangerously In Love Be With You
0.750 Dangerously In Love Me, Myself and I
0.662 Dangerously In Love Yes
0.447 Dangerously In Love Signs (feat. Missy Elliott)
0.568 Dangerously In Love Speechless
0.493 Dangerously In Love That’s How You Like It (feat. Jay-Z)
0.652 Dangerously In Love The Closer I Get to You (feat. Beyoncé Knowles)
0.609 Dangerously In Love Dangerously In Love
0.650 Dangerously In Love Beyoncé Interlude
0.388 Dangerously In Love Gift from Virgo
0.469 Dangerously In Love Daddy
0.664 Dangerously In Love Crazy In Love (feat. Jay-Z)
0.735 Dangerously In Love Naughty Girl
0.689 Dangerously In Love Baby Boy (feat. Sean Paul)
0.741 Dangerously In Love Hip Hop Star (feat. Big Boi & Sleepy Brown)
0.710 Dangerously In Love Be With You
0.747 Dangerously In Love Me, Myself and I
0.638 Dangerously In Love Yes
0.373 Dangerously In Love Signs (feat. Missy Elliott)
0.542 Dangerously In Love Speechless
0.435 Dangerously In Love That’s How You Like It (feat. Jay-Z)
0.630 Dangerously In Love The Closer I Get to You (feat. Beyoncé Knowles)
0.619 Dangerously In Love Dangerously In Love
0.693 Dangerously In Love Beyoncé Interlude
0.349 Dangerously In Love Gift from Virgo
0.683 Dangerously In Love Work It Out
0.618 Dangerously In Love ’03 Bonnie & Clyde (feat. Beyoncé)

“Me, Myself and I” has the highest dancability with .747

Can each track’s danceability be shown in a graph?

DILAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within Dangerously In Love?

ggplot(DILAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in Dangerously In Love")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in Dangerously in Love

ggplot(data = DILAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "Dangerously In Love Album Danceability")

“B’Day”

B’Day is Beyoncé’s second studio album. Columbia Records, Music World Entertainment, and Sony Urban Music published it on September 4, 2006, to coincide with her twenty-fifth birthday in several countries, and a day later in the United States.

Beyonce_BDay <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_BDay.xlsx")
View(Beyonce_BDay)

How many words are in this album

Beyonce_BDay %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1  6286

6286

How many times do the most popular words occur within the album

Beyonce_BDay %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  head(10) %>%
  knitr::kable()
word n
mama 52
hey 39
body 37
upgrade 33
baby 30
bodied 30
time 27
dress 26
freakum 25
light 25

What is the sentiment of these words?

Beyonce_BDay %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  head(10) %>%
  knitr::kable()
word n sentiment value
lied 15 negative -2
damned 12 negative -4
alarm 5 negative -2
hurt 5 negative -2
easy 4 positive 1
hard 4 negative -1
hate 4 negative -3
love 4 positive 3
pretend 4 negative -1
impress 3 positive 3

Majority have negative sentiment but these are without the soft & stop words.

What words stand out the most in a word cloud?

Beyonce_BDay %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  wordcloud2()

“hey,”baby”, “mama”

Loading Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "B'Day") -> BDayAlbum
View(BDayAlbum)

Which track in B’Day has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "B'Day") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.763 B’Day Deja Vu (feat. Jay-Z)
0.865 B’Day Get Me Bodied
0.682 B’Day Suga Mama
0.474 B’Day Upgrade U (feat. Jay-Z)
0.456 B’Day Ring The Alarm
0.810 B’Day Kitty Kat
0.683 B’Day Freakum Dress
0.796 B’Day Green Light
0.576 B’Day Irreplaceable
0.378 B’Day Resentment
0.706 B’Day Encore For The Fans
0.483 B’Day Listen (From the Motion Picture “Dreamgirls”)
0.911 B’Day Get Me Bodied - Extended Mix
0.763 B’Day Deja Vu (feat. Jay-Z)
0.865 B’Day Get Me Bodied
0.682 B’Day Suga Mama
0.474 B’Day Upgrade U (feat. Jay-Z)
0.456 B’Day Ring The Alarm
0.810 B’Day Kitty Kat
0.683 B’Day Freakum Dress
0.796 B’Day Green Light
0.576 B’Day Irreplaceable
0.378 B’Day Resentment
0.706 B’Day Encore For The Fans
0.483 B’Day Listen (From the Motion Picture “Dreamgirls”)
0.911 B’Day Get Me Bodied - Extended Mix
0.763 B’Day Deja Vu (feat. Jay-Z)
0.865 B’Day Get Me Bodied
0.682 B’Day Suga Mama
0.474 B’Day Upgrade U (feat. Jay-Z)
0.456 B’Day Ring The Alarm
0.810 B’Day Kitty Kat
0.683 B’Day Freakum Dress
0.796 B’Day Green Light
0.576 B’Day Irreplaceable
0.378 B’Day Resentment
0.705 B’Day Check On It (feat. Bun B & Slim Thug)
0.761 B’Day Deja Vu (feat. Jay-Z)
0.864 B’Day Get Me Bodied
0.714 B’Day Suga Mama
0.676 B’Day Upgrade U (feat. Jay-Z)
0.457 B’Day Ring The Alarm
0.819 B’Day Kitty Kat
0.689 B’Day Freakum Dress
0.795 B’Day Green Light
0.453 B’Day Irreplaceable
0.440 B’Day Resentment
0.702 B’Day Check On It (feat. Bun B & Slim Thug)
0.634 B’Day Deja Vu (feat. Jay-Z) - The Remix
0.722 B’Day Encore For The Fans
0.456 B’Day Listen (From the Motion Picture “Dreamgirls”)
0.908 B’Day Get Me Bodied - Extended Mix
0.763 B’Day Deja Vu (feat. Jay-Z)
0.865 B’Day Get Me Bodied
0.682 B’Day Suga Mama
0.474 B’Day Upgrade U (feat. Jay-Z)
0.456 B’Day Ring The Alarm
0.810 B’Day Kitty Kat
0.683 B’Day Freakum Dress
0.796 B’Day Green Light
0.576 B’Day Irreplaceable
0.378 B’Day Resentment
0.705 B’Day Check On It (feat. Bun B & Slim Thug)

“Get Me Bodied” has the highest dancability with .865

Each track’s danceability shown in a graph

BDayAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within B’Day?

ggplot(BDayAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in B'Day")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in B’Day

ggplot(data = BDayAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "B'Day Album Danceability")

“I Am…Sasha Fierce”

I Am… Sasha Fierceis Beyoncé’sthird studio album. Columbia Records and Music World Entertainment released it on November 12, 2008. The album was originally released as a double album in order to advertise Beyoncé’s contradictory creative identity.

Beyonce_SF <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_SF.xlsx")
View(Beyonce_SF)

How many words are in this album

Beyonce_SF %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1  9049

9049

How many times do the most popular words occur within the album

Beyonce_SF %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  head(10) %>%
  knitr::kable()
word n
halo 67
love 66
video 64
whoa 44
phone 42
baby 39
wanna 39
diva 32
ego 32
feel 29

What is the sentiment of these words?

Beyonce_SF %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  head(10) %>%
  knitr::kable()
word n sentiment value
love 66 positive 3
scared 21 negative -2
beautiful 20 positive 3
poison 14 negative -2
lonely 13 negative -2
lost 12 negative -3
strong 12 positive 2
sweet 9 positive 2
broken 8 negative -1
cool 8 positive 1

What words stand out the most in a word cloud

Beyonce_SF %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  wordcloud2()

“love”, “halo”, “video”

Loading Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "I AM...SASHA FIERCE") -> SFAlbum
View(SFAlbum)

Which track in Coloring Book has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "I AM...SASHA FIERCE") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.633 I AM…SASHA FIERCE If I Were a Boy
0.511 I AM…SASHA FIERCE Halo
0.552 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.349 I AM…SASHA FIERCE Ave Maria
0.306 I AM…SASHA FIERCE Satellites
0.551 I AM…SASHA FIERCE Save The Hero
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.693 I AM…SASHA FIERCE Sweet Dreams
0.452 I AM…SASHA FIERCE Video Phone
0.693 I AM…SASHA FIERCE Why Don’t You Love Me
0.632 I AM…SASHA FIERCE If I Were a Boy
0.508 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.204 I AM…SASHA FIERCE Satellites
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone
0.632 I AM…SASHA FIERCE If I Were a Boy
0.508 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.572 I AM…SASHA FIERCE Smash Into You
0.384 I AM…SASHA FIERCE Satellites
0.549 I AM…SASHA FIERCE That’s Why You’re Beautiful
0.551 I AM…SASHA FIERCE Save The Hero
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone
0.330 I AM…SASHA FIERCE Hello
0.623 I AM…SASHA FIERCE Ego
0.534 I AM…SASHA FIERCE Scared of Lonely
0.693 I AM…SASHA FIERCE Why Don’t You Love Me
0.632 I AM…SASHA FIERCE If I Were a Boy
0.510 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.572 I AM…SASHA FIERCE Smash Into You
0.384 I AM…SASHA FIERCE Satellites
0.549 I AM…SASHA FIERCE That’s Why You’re Beautiful
0.551 I AM…SASHA FIERCE Save The Hero
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone
0.330 I AM…SASHA FIERCE Hello
0.623 I AM…SASHA FIERCE Ego
0.534 I AM…SASHA FIERCE Scared of Lonely
0.632 I AM…SASHA FIERCE If I Were a Boy
0.508 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.572 I AM…SASHA FIERCE Smash Into You
0.384 I AM…SASHA FIERCE Satellites
0.549 I AM…SASHA FIERCE That’s Why You’re Beautiful
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone
0.330 I AM…SASHA FIERCE Hello
0.623 I AM…SASHA FIERCE Ego
0.534 I AM…SASHA FIERCE Scared of Lonely
0.632 I AM…SASHA FIERCE If I Were a Boy
0.508 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.204 I AM…SASHA FIERCE Satellites
0.551 I AM…SASHA FIERCE Save The Hero
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone
0.632 I AM…SASHA FIERCE If I Were a Boy
0.508 I AM…SASHA FIERCE Halo
0.492 I AM…SASHA FIERCE Disappear
0.336 I AM…SASHA FIERCE Broken-Hearted Girl
0.350 I AM…SASHA FIERCE Ave Maria
0.204 I AM…SASHA FIERCE Satellites
0.545 I AM…SASHA FIERCE Save The Hero
0.426 I AM…SASHA FIERCE Single Ladies (Put a Ring on It)
0.605 I AM…SASHA FIERCE Radio
0.875 I AM…SASHA FIERCE Diva
0.694 I AM…SASHA FIERCE Sweet Dreams
0.479 I AM…SASHA FIERCE Video Phone

“Diva” has the highest dancability with .875

Each track’s danceability shown in a graph

SFAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within Coloring Book?

ggplot(SFAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in I Am...Sasha Fierce")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in I Am…Sasha Fierce

ggplot(data = SFAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "I Am...Sasha Fierce Album Danceability")

“4”

4 is the fourth studio album by American singer Beyoncé. It was released on June 24, 2011, by Parkwood Entertainment and Columbia Records.

Beyonce_4 <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_4.xlsx")
View(Beyonce_4)

How many words are in this album

Beyonce_4 %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1  7232

7232

How many times do the most popular words occur within the album

Beyonce_4 %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  head(10) %>%
  knitr::kable()
word n
love 101
baby 73
run 54
tonight 53
girls 51
wanna 45
world 41
babe 40
hey 35
top 35

What is the sentiment of these words?

Beyonce_4 %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  head(10) %>%
  knitr::kable()
word n sentiment value
love 101 positive 3
top 35 positive 2
bad 13 negative -3
die 12 negative -3
crazy 9 negative -2
loved 9 positive 3
worry 9 negative -3
sucks 8 negative -3
miss 7 negative -2
promise 7 positive 1

mix of positive and negative words. list of words changes due to which can be measured by sentiment or not.

What words stand out the most in a word cloud

Beyonce_4 %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  wordcloud2()

“love”, “baby”, “girls”, “run”, “world”, “tonight”

Loading Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "4") -> FourAlbum
View(FourAlbum)

Which track in the 4 has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "4") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.652 4 Love On Top
0.648 4 Party (feat. André 3000)
0.799 4 Schoolin’ Life
0.665 4 Countdown
0.718 4 I Miss You
0.616 4 Dance for You
0.371 4 I Care
0.628 4 Rather Die Young
0.303 4 1+1
0.711 4 End of Time
0.733 4 Run the World (Girls)
0.545 4 Best Thing I Never Had
0.474 4 Start Over
0.510 4 I Was Here
0.303 4 1+1
0.371 4 I Care
0.718 4 I Miss You
0.545 4 Best Thing I Never Had
0.648 4 Party (feat. André 3000)
0.628 4 Rather Die Young
0.474 4 Start Over
0.652 4 Love On Top
0.665 4 Countdown
0.711 4 End of Time
0.510 4 I Was Here
0.733 4 Run the World (Girls)
0.303 4 1+1
0.371 4 I Care
0.718 4 I Miss You
0.545 4 Best Thing I Never Had
0.648 4 Party (feat. André 3000)
0.628 4 Rather Die Young
0.474 4 Start Over
0.652 4 Love On Top
0.665 4 Countdown
0.711 4 End of Time
0.510 4 I Was Here
0.733 4 Run the World (Girls)
0.303 4 1+1
0.371 4 I Care
0.718 4 I Miss You
0.545 4 Best Thing I Never Had
0.648 4 Party (feat. André 3000)
0.628 4 Rather Die Young
0.474 4 Start Over
0.652 4 Love On Top
0.665 4 Countdown
0.711 4 End of Time
0.510 4 I Was Here
0.733 4 Run the World (Girls)
0.724 4 Lay Up Under Me
0.799 4 Schoolin’ Life
0.616 4 Dance for You
0.650 4 Run the World (Girls) - Kaskade Club Remix
0.728 4 Run the World (Girls) - RedTop Club Remix
0.806 4 Run the World (Girls) - Jochen Simms Club Remix

“Run the World (Girls)” has the highest dancability with .806

Each track’s danceability shown in a graph

FourAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within 4?

ggplot(FourAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in 4")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in 4

ggplot(data = FourAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "4 Album Danceability")

“BEYONCE”

Beyoncé is the eponymous fifth studio album by American singer Beyoncé. The record was released on December 13, 2013, by Parkwood Entertainment and Columbia Records. Developed as a “visual album”, its songs are accompanied by non-linear short films that illustrate the musical concepts conceived during production.

Beyonce_B <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_B.xlsx")
View(Beyonce_B)

How many words are in this album

Beyonce_B %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1  6821

6821

How many times do the most popular words occur within the album

Beyonce_B %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  head(10) %>%
  knitr::kable()
word n
baby 75
love 56
girl 52
beyonc 45
hold 44
wanna 34
mine 31
cherry 28
lights 21
rock 21

What is the sentiment of these words?

Beyonce_B %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  head(10) %>%
  knitr::kable()
word n sentiment value
love 56 positive 3
heaven 16 positive 2
pretty 15 positive 1
bad 12 negative -3
hurts 12 negative -2
jealous 10 negative -2
shit 8 negative -4
haunting 7 negative 1
loving 7 positive 2
promise 7 positive 1

What words stand out the most in a word cloud

Beyonce_B %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  wordcloud2()

“baby”, “girl”, “love”, “mine”

Loading Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "BEYONCÉ [Platinum Edition]") -> BAlbum
View(BAlbum)

Which track in the BEYONCÉ [Platinum Edition] has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "BEYONCÉ [Platinum Edition]") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.512 BEYONCÉ [Platinum Edition] Pretty Hurts
0.436 BEYONCÉ [Platinum Edition] Haunted
0.589 BEYONCÉ [Platinum Edition] Drunk in Love (feat. Jay-Z)
0.875 BEYONCÉ [Platinum Edition] Blow
0.571 BEYONCÉ [Platinum Edition] No Angel
0.412 BEYONCÉ [Platinum Edition] Partition
0.589 BEYONCÉ [Platinum Edition] Jealous
0.495 BEYONCÉ [Platinum Edition] Rocket
0.557 BEYONCÉ [Platinum Edition] Mine (feat. Drake)
0.470 BEYONCÉ [Platinum Edition] XO
0.476 BEYONCÉ [Platinum Edition] ***Flawless (feat. Chimamanda Ngozi Adichie)
0.527 BEYONCÉ [Platinum Edition] Superpower (feat. Frank Ocean)
0.342 BEYONCÉ [Platinum Edition] Heaven
0.459 BEYONCÉ [Platinum Edition] Blue (feat. Blue Ivy)
0.747 BEYONCÉ [Platinum Edition] 7/11
0.639 BEYONCÉ [Platinum Edition] Flawless Remix (feat. Nicki Minaj)
0.514 BEYONCÉ [Platinum Edition] Drunk in Love Remix (feat. Jay-Z & Kanye West)
0.732 BEYONCÉ [Platinum Edition] Ring Off
0.872 BEYONCÉ [Platinum Edition] Blow Remix (feat. Pharrell Williams)
0.354 BEYONCÉ [Platinum Edition] Standing on the Sun Remix (feat. Mr. Vegas)
0.512 BEYONCÉ [Platinum Edition] Pretty Hurts
0.468 BEYONCÉ [Platinum Edition] Haunted
0.591 BEYONCÉ [Platinum Edition] Drunk in Love (feat. Jay-Z)
0.875 BEYONCÉ [Platinum Edition] Blow
0.571 BEYONCÉ [Platinum Edition] No Angel
0.447 BEYONCÉ [Platinum Edition] Partition
0.590 BEYONCÉ [Platinum Edition] Jealous
0.498 BEYONCÉ [Platinum Edition] Rocket
0.556 BEYONCÉ [Platinum Edition] Mine (feat. Drake)
0.467 BEYONCÉ [Platinum Edition] XO
0.491 BEYONCÉ [Platinum Edition] ***Flawless (feat. Chimamanda Ngozi Adichie)
0.527 BEYONCÉ [Platinum Edition] Superpower (feat. Frank Ocean)
0.342 BEYONCÉ [Platinum Edition] Heaven
0.459 BEYONCÉ [Platinum Edition] Blue (feat. Blue Ivy)
0.747 BEYONCÉ [Platinum Edition] 7/11
0.645 BEYONCÉ [Platinum Edition] Flawless Remix (feat. Nicki Minaj)
0.475 BEYONCÉ [Platinum Edition] Drunk in Love Remix (feat. Jay-Z & Kanye West)
0.731 BEYONCÉ [Platinum Edition] Ring Off
0.875 BEYONCÉ [Platinum Edition] Blow Remix (feat. Pharrell Williams)
0.456 BEYONCÉ [Platinum Edition] Standing on the Sun Remix (feat. Mr. Vegas)

“Blow” has the highest dancability with .875

Each track’s danceability shown in a graph

BAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within BEYONCÉ [Platinum Edition]?

ggplot(BAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in BEYONCÉ [Platinum Edition]")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in BEYONCÉ [Platinum Edition]

ggplot(data = BAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "BEYONCÉ [Platinum Edition] Album Danceability")

“Lemonade”

Lemonade is the sixth studio album by American singer Beyoncé. It was released on April 23, 2016, by Parkwood Entertainment and Columbia Records, accompanied by a 65-minute film of the same title on HBO.

Beyonce_Lem <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce_Lem.xlsx")
View(Beyonce_Lem)

How many words are in this album

Beyonce_Lem %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  count()
## # A tibble: 1 × 1
##       n
##   <int>
## 1 10220

10220

How many times do the most popular words occur within the album

Beyonce_Lem %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>% 
  filter(!word %in% c("vo")) %>%
  head(10) %>%
  knitr::kable()
word n
beyonc 225
cut 154
love 105
slay 49
daddy 40
shot 39
black 35
closeup 35
women 32
girl 30

What is the sentiment of these words?

Beyonce_Lem %>% 
  unnest_tokens(word, Lyric) %>%
  select(word) %>%
  anti_join(stop_words) %>%
  count(word, sort = TRUE) %>%
  inner_join(get_sentiments("bing")) %>% 
  inner_join(get_sentiments("afinn")) %>% 
  filter(!word %in% c("vo")) %>%
  head(10) %>%
  knitr::kable()
word n sentiment value
love 105 positive 3
freedom 21 positive 2
hurt 20 negative -2
sweet 10 positive 2
worth 10 positive 2
hard 9 negative -1
bitch 7 negative -5
fuck 7 negative -4
broken 6 negative -1
crazy 6 negative -2

What words stand out the most in a word cloud

Beyonce_Lem %>% 
  unnest_tokens(word, Lyric) %>% 
  select(word) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) %>% 
  filter(!word %in% c("vo")) %>%
  wordcloud2()

“beyonce”, “cut”, “love”, “slay”

Loading Spotify Data
Beyonce_Spotify %>% 
  filter(album_name %in% "Lemonade") -> LemAlbum
View(LemAlbum)

Which track in the Big Day has the highest danceability?

Beyonce_Spotify %>% 
  filter(album_name %in% "Lemonade") %>% 
  select(danceability, album_name, track_name) %>% 
  kable()
danceability album_name track_name
0.250 Lemonade Pray You Catch Me
0.524 Lemonade Hold Up
0.614 Lemonade Don’t Hurt Yourself (feat. Jack White)
0.775 Lemonade Sorry
0.516 Lemonade 6 Inch (feat. The Weeknd)
0.643 Lemonade Daddy Lessons
0.455 Lemonade Love Drought
0.330 Lemonade Sandcastles
0.387 Lemonade Forward (feat. James Blake)
0.437 Lemonade Freedom (feat. Kendrick Lamar)
0.574 Lemonade All Night
0.896 Lemonade Formation
0.546 Lemonade Sorry - Original Demo
0.249 Lemonade Pray You Catch Me
0.490 Lemonade Hold Up
0.619 Lemonade Don’t Hurt Yourself (feat. Jack White)
0.785 Lemonade Sorry
0.530 Lemonade 6 Inch (feat. The Weeknd)
0.618 Lemonade Daddy Lessons
0.491 Lemonade Love Drought
0.381 Lemonade Sandcastles
0.383 Lemonade Forward (feat. James Blake)
0.458 Lemonade Freedom (feat. Kendrick Lamar)
0.564 Lemonade All Night
0.733 Lemonade Formation
0.522 Lemonade Sorry - Original Demo

“Formation” has the highest dancability with .896

Each track’s danceability shown in a graph

LemAlbum %>% 
  ggplot()+
  geom_col(aes(x=track_name, y=danceability))+
  theme_economist()+
  theme(axis.text.x = element_text(angle = 90))

What is the distribution of the danceability within Lemonade?

ggplot(LemAlbum, aes(x=danceability)) +
  geom_density(alpha=0.7)+
  labs(x="Danceability", y="Density") +
  theme_economist()+
  ggtitle("Distribution of Danceability Data in Lemonade")

Using a heatmap code created by http://student.elon.edu/bwilliamson5/FinalProject/index.html to analyze danceability in Lemonade

ggplot(data = LemAlbum, aes(x = danceability, y = track_name)) +
  geom_tile(aes(fill=danceability, height=1 , width=.1),colour="red") +
  scale_y_discrete(breaks = DILAlbum$track_name) +
  scale_fill_gradient2(low = "#FF0000", midpoint=0.6,
                       space="Lab", mid="#FFE500", high = "#09B505") +
  labs(x = "Danceability") +
  labs(y = "Track Name") +
  labs(title = "Lemonade Album Danceability")

Downloading all albums together for a joint analysis

Beyonce <- read_excel("~/Desktop/MEA_4600/Passion_Project/Beyonce.xlsx")
View(Beyonce)

Removing any stop and soft words leaving only sentiment words left

Beyonce %>% 
  unnest_tokens(word, Lyric) %>% 
  anti_join(stop_words) %>% 
  count(word, sort = TRUE) -> beyonce_word_count

What words occur the most throughout all his albums

wordcloud2(beyonce_word_count)

“love”, “baby”, “time”, “cut”, “feel”

How much the 20 most common words are used throughout the albums

beyonce_word_count %>% 
  head(20) %>% 
  ggplot(aes(reorder(word, n), n)) +
  geom_col() +
  coord_flip() +
  theme_economist()

Finding the sentiments of the most common used words throughout the albums

beyonce_word_count %>% 
  inner_join(get_sentiments("afinn"))-> beyonce_sentiment
View(beyonce_sentiment)

What is the overall sentiment of his works

mean(beyonce_sentiment$value)
## [1] -0.2714681

-0.27

Are the words used in Beyonce’s lyrics positive or negative?

beyonce_word_count %>% 
  inner_join(get_sentiments("bing")) -> beyonce_sentiment2
View(beyonce_sentiment2)

How many negative words are there in comparison to positive words?

beyonce_sentiment2 %>% 
  ggplot() + geom_col(aes(sentiment, n)) + theme_economist()

Overall analysis using Spotify data
key_mode n
C# major 120
G major 80
F# major 58
C major 52
D major 35
G# major 35
A# major 33
F major 33
F# minor 30
A minor 27

C major and G major are used most often in pop music –> https://mixedinkey.com/captain-plugins/wiki/common-chord-progressions-pop-music/#

what is the most joyful Beyonce song?

Beyonce_Spotify %>% 
  arrange(-valence) %>% 
  select(track_name, valence) %>% 
  head(15) %>% 
  kable()
track_name valence
Hip Hop Star (feat. Big Boi & Sleepy Brown) 0.971
Hip Hop Star (feat. Big Boi & Sleepy Brown) 0.968
Hip Hop Star (feat. Big Boi & Sleepy Brown) 0.968
Work It Out 0.948
Work It Out 0.948
Hold Up - Homecoming Live 0.922
Check On It (feat. Bun B & Slim Thug) 0.922
Check On It (feat. Bun B & Slim Thug) 0.922
Hold Up - Homecoming Live 0.906
If I Were a Boy - Maurice Joshua Mojo UK Remix - Main 0.885
Check On It (feat. Bun B & Slim Thug) 0.881
Diva 0.875
JA ARA E 0.867
JA ARA E 0.867
Check On It (feat. Bun B & Slim Thug) 0.864

Hip Hop Star (feat. Big Boi & Sleepy Brown) is the most joyful song by Beyonce

Valence by album:

Beyonce_Spotify %>%
  group_by(album_name) %>%
  summarise(mean(valence)) %>%
  arrange(desc(`mean(valence)`)) %>%
  kable()
album_name mean(valence)
Above And Beyoncé Dance Mixes 0.6187875
Dangerously In Love 0.5578452
Dangerously In Love (Alben für die Ewigkeit) 0.5563875
4 0.5330179
B’Day 0.5313810
B’Day Deluxe Edition 0.5204405
The Lion King: The Gift [Deluxe Edition] 0.4217765
I AM…SASHA FIERCE NEW DELUXE EDITION 0.4066667
I AM…SASHA FIERCE 0.4036061
Lemonade 0.4025846
HOMECOMING: THE LIVE ALBUM 0.3929712
I AM…SASHA FIERCE - Platinum Edition 0.3848905
BEYONCÉ [Platinum Edition] 0.3727825
The Lion King: The Gift 0.3616630
The Beyonce Experience Live Audio 0.2849619
I Am…World Tour 0.2692640

Dangerously In Love is the most joyful album

Which album has the biggest emotional journey?

ggplot(Beyonce_Spotify, aes(x = valence, y = album_name)) + 
  geom_joy() + 
  theme_economist() +
  ggtitle("Joyplot of Beyonce's joy distributions", 
          subtitle = "Based on valence pulled from Spotify's Web API with spotifyr")

B’Day has the biggest emotional journey and Dangerously in Love in the most joyful

Using code from https://msmith7161.github.io/what-is-speechiness/, I will be looking at how Danceability was distributed between the albums

green <- "#1ed760"
yellow <- "#e7e247"
pink <- "#ff6f59"
blue <- "#17bebb"
red <- "#d71e1e"
orange <- "#f28c07"
purple <- "#2e07f2"
brown <- "#964B00"
gray <- "#808080"
navy <- "#00205B"
teal <- "#008080"
hot_pink <- "#FF69B4"
baby_blue <- "#AED6F1"
light_purple <- "#D7BDE2"
fuscha <- "#C233FF"
forest <- "#145A32"

ggplot(Beyonce_Spotify, aes(x=danceability, fill=album_name,
                              text = paste(album_name)))+
  geom_density(alpha=0.7, color=NA)+
  scale_fill_manual(values=c(green, yellow, pink, blue, red, orange, purple, brown, gray, navy, teal, hot_pink, baby_blue, light_purple, fuscha, forest))+
  labs(x="Danceability", y="Density") +
  guides(fill=guide_legend(title="Album Name"))+
  theme_economist()+
  ggtitle("Distribution of Danceability Data")

Overall Conclusion:

From my analysis I believe Beyonce’s music has changed in correlations from life events. Her beginning albums began as girl-ish talking about love and the search for romance. We see women empowerment in her middle albums, a time when Beyonce truly knew how powerful of a business women she is, and then her last album, which featured some darker, more edgy vibes which was released in tandem with rumors of her husband’s infidelity. Though she still stayed true to her themes of pop and R&B, we can see movement from each album to the next.