library(genius)
library(wordcloud2)
library(tidytext)
library(tidyverse)
library(ggthemes)
library(devtools)stoneSourAlbums <-tribble(
~ artist, ~ title,
"Stone Sour", "Come What(ever) May",
"Stone Sour", "Audio Secrecy",
"Stone Sour", "Hydrograd",
)
stoneSourLyrics <- stoneSourAlbums %>%
add_genius(artist, title, type = "album")
slipknotAlbums <- tribble(
~ artist, ~ title,
"Slipknot", "Vol. 3: (The Subliminal Verses)",
"Slipknot", "All Hope Is Gone",
"Slipknot", "We Are Not Your Kind",
)
slipknotLyrics <- slipknotAlbums %>%
add_genius(artist, title, type = "album")stoneSourLyrics %>%
filter(title %in% "Come What(ever) May") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "30") %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#0b7c76") -> tenComeWhatever
tenComeWhatever +
ggtitle("Come What(ever) May: Top 10 Words") + theme(plot.title = element_text(hjust = 0.5)) + scale_color_fivethirtyeight() + theme_fivethirtyeight() stoneSourLyrics %>%
filter(title %in% "Come What(ever) May") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "30") %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> comeSent
comeSent %>%
head(10) ## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 die 14 -3
## 2 god 11 1
## 3 care 9 2
## 4 stop 8 -1
## 5 afraid 7 -2
## 6 free 7 1
## 7 refuse 6 -2
## 8 shit 6 -4
## 9 tired 6 -2
## 10 fight 5 -1
slipknotLyrics %>%
filter(title %in% "Vol. 3: (The Subliminal Verses)") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#e69e5b") -> tenVolThree
tenVolThree +
ggtitle("Vol. 3: (The Subliminal Verses): Top 10 Words") + theme(plot.title = element_text(hjust = 0.5)) + scale_color_fivethirtyeight() + theme_fivethirtyeight() slipknotLyrics %>%
filter(title %in% "Vol. 3: (The Subliminal Verses)") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> volThreeSent
volThreeSent %>%
head(10) ## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 die 15 -3
## 2 forget 15 -1
## 3 leave 12 -1
## 4 insane 11 -2
## 5 fight 8 -1
## 6 save 8 2
## 7 love 6 3
## 8 pain 6 -2
## 9 stop 6 -1
## 10 alive 5 1
stoneSourLyrics %>%
filter(title %in% "Audio Secrecy") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#0b7c76") -> tenAudio
tenAudio +
ggtitle("Audio Secrecy: Top 10 Words") + theme(plot.title = element_text(hjust = 0.5))+ scale_color_fivethirtyeight() + theme_fivethirtyeight() stoneSourLyrics %>%
filter(title %in% "Audio Secrecy") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> audioSent
audioSent %>%
head(10) ## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 die 16 -3
## 2 save 14 2
## 3 wrong 11 -2
## 4 hate 10 -3
## 5 haunt 10 -1
## 6 destroy 9 -3
## 7 love 7 3
## 8 true 7 2
## 9 free 6 1
## 10 honest 6 2
slipknotLyrics %>%
filter(title %in% "All Hope Is Gone") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "hey") %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#e69e5b") -> tenAllHope
tenAllHope +
ggtitle("All Hope Is Gone: Top 10 Words") + theme(plot.title = element_text(hjust = 0.5)) + scale_color_fivethirtyeight() + theme_fivethirtyeight()slipknotLyrics %>%
filter(title %in% "All Hope Is Gone") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "hey") %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> allHopeSent
allHopeSent %>%
head(10)## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 pretend 24 -1
## 2 dead 21 -3
## 3 die 21 -3
## 4 save 16 2
## 5 hope 15 2
## 6 free 13 1
## 7 care 12 2
## 8 war 10 -2
## 9 god 8 1
## 10 killing 8 -3
stoneSourLyrics %>%
filter(title %in% "Hydrograd") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#0b7c76") -> tenHydrograd
tenHydrograd +
ggtitle("Hydrograd: Top 10 Words") + theme(plot.title = element_text(hjust = 0.5)) + theme_dark() + scale_color_fivethirtyeight() + theme_fivethirtyeight() stoneSourLyrics %>%
filter(title %in% "Hydrograd") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
filter(!word %in% "yeah") %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> hydrogradSent
hydrogradSent %>%
head(10) ## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 love 14 3
## 2 feeling 13 1
## 3 dead 12 -3
## 4 shit 11 -4
## 5 fucking 10 -4
## 6 bad 9 -3
## 7 motherfucker 8 -5
## 8 saved 8 2
## 9 fire 7 -2
## 10 fuck 7 -4
slipknotLyrics %>%
filter(title %in% "We Are Not Your Kind") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
count(word, sort = TRUE) %>%
head(10) %>%
ggplot(aes(reorder(word, -n), n)) + geom_col(fill="#e69e5b")-> tenKind
tenKind +
ggtitle("We Are Not Your Kind: Top 10 Words") + theme(plot.title = element_text(hjust = 0.5))+ scale_color_fivethirtyeight() + theme_fivethirtyeight() slipknotLyrics %>%
filter(title %in% "We Are Not Your Kind") %>%
unnest_tokens(word, lyric) %>%
anti_join(stop_words) %>%
count(word, sort = TRUE) %>%
inner_join(get_sentiments("afinn")) -> kindSent
kindSent %>%
head(10) ## # A tibble: 10 x 3
## word n value
## <chr> <int> <dbl>
## 1 love 25 3
## 2 death 18 -2
## 3 liar 17 -3
## 4 kill 10 -3
## 5 pain 9 -2
## 6 worst 9 -3
## 7 hell 8 -4
## 8 hope 8 2
## 9 enemy 7 -2
## 10 fuck 7 -4