THE SPICE GIRLS: What Makes a Good Album?
The Spice Girls were an English Musical Girls Group popular from the mid-90s to the early 2000s, known for their upbeat pop music. The five person musical group has members Melanie Brown (Mel B), Melanie Chisholm (Mel C), Emma Bunton Geri Halliwell, and Victoria Beckham.
Following their success, we thought it would be interesting to take a look at how different aspects of their music may altered over time after the release of their three albums.
More About The Data
The following data in this R Markdown was utilized from the link here.
The following document was created using an R Markdown file, with an html output. The libraries used for this project were as follows:
- highcharter
- dplyr
The libraries were hidden from the outputed code and knitted html file.
The variables we decided to subset were track names, tempo, valence, album_name, loudness, and danceability. Tempo is defined as the beats per measure (BPM) of a song. Valence was defined on a scale of 0.0 to 1.0, depending on the level of ‘musical positiveness’ conveyed by each track, with higher scores indicating higher positivity. Loudness was defined on a scale of decibels depending on the loudness of each respective track. Finally, danceability was measured using a combination of factors from the song including: beat strength, tempo stability, and the overall tempo.
We believe the combination of these factors will help assist us in viewing a trend over time for the Spice Girls albums, answering the question of whether they became more valent, or positive over time, and if they became more energetic.
Our Analysis
Our analysis seeks to investigate the variety of Spice Girls albums and tracks compared to their valence levels, as well as investigating which albums are the most valent and energetic.
The following code produces a new subsection of the dataset only containing our variables of interest as follows:
- track_name
- tempo
- danceability
- valence
- album_name
Reading in the data
spicegirlsraw <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-12-14/studio_album_tracks.csv')Subsetting the data
The data is subsetted by several variables of interest as recorded in the code below:
spicegirls <- spicegirlsraw[c('track_name', 'tempo', 'valence', 'album_name',
'loudness', 'danceability')]Numerical Summary of Data:
The following numerical summary shows a variety of aspects of our subsetted dataset, including but not limited to: minimums, maximums, and medians per each variable, as well as the class for character variables. The summary function was used to create this table, which creates a summary description of the dataset placed in the function itself.
summary(spicegirls)## track_name tempo valence album_name
## Length:31 Min. : 80.14 Min. :0.0734 Length:31
## Class :character 1st Qu.:100.01 1st Qu.:0.5160 Class :character
## Mode :character Median :107.02 Median :0.7510 Mode :character
## Mean :114.74 Mean :0.6577
## 3rd Qu.:121.01 3rd Qu.:0.8385
## Max. :190.16 Max. :0.9650
## loudness danceability
## Min. :-9.328 Min. :0.3010
## 1st Qu.:-7.835 1st Qu.:0.5800
## Median :-5.547 Median :0.6910
## Mean :-5.993 Mean :0.6544
## 3rd Qu.:-4.780 3rd Qu.:0.7265
## Max. :-2.316 Max. :0.8600
Creating New Variables:
To better investigate the trend of energy across the spice girls albums, we decided to calculate a new variable labeled ‘energy’, which is a measure of the overall energy a song emits based on the tempo multiplied by the danceability. Higher scores in this field indicate higher energy tracks.
spicegirls$energy <- spicegirls$valence * spicegirls$tempoGrouping and Sorting
The subsetted data was then grouped by album name for better ease of viewing and to keep all tracks of an album together.
spicegirls <- spicegirls %>% group_by(album_name)Scatterplot
The following scatterplot investigates each individual track name compared to their valence, with a color indication based on the album name. The r package highcharter was used to create this scatterplot, alongside the pipe operator from the dplyr package. A variety of functions were used to better visualize this graph. hc_title, hc_subtitle, hc_XAxis, and hc_YAxis all allowed us to title our graph, with a subtitle and label each axis by what is being measured, all alongside the hchart function which gave us a plethora of options for the creation of our graphs.
library(highcharter)
library(dplyr)
hchart(
spicegirls,
type = "scatter",
hcaes(x = "track_name", y = "valence", group = "album_name", fill = "album_name"))%>%
hc_title(text = "Spice Girls Tracks by Valence")%>%
hc_xAxis(title = list(text = "Track Name"))%>%
hc_yAxis(title = list(text = "Valence"))%>%
hc_subtitle(text = "<b>3470 Project 1<b>")%>%
hc_legend(align = "right", verticalAlign = "top",
layout = "vertical", x = 0, y = 100)%>%
hc_add_theme(hc_theme_darkunica())Bar Graph
The following bar graph investigates the newly calculated variable, ‘energy’ in comparison to each of the spice girls tracks. The r package highcharter was used for this graph as well, and contains various functions to label x and y axes, titles and subtitles, and align the legend. The usage of these functions helped convey our overall visual message much clearer. The pipe operator was used from the dplyr R package in order to better join our code.
library(highcharter)
hchart(
spicegirls,
"bar",
hcaes(x = 'track_name', y = 'energy', group = album_name, fill = 'album_name'))%>%
hc_title(text = "Spice Girls Tracks by Energy Level")%>%
hc_xAxis(title = list(text = "Track Name"))%>%
hc_yAxis(title = list(text = "Energy Level"))%>%
hc_subtitle(text = "<b>3470 Project 1<b>") %>%
hc_legend(align = "right", verticalAlign = "top",
layout = "vertical", x = 0, y = 100)%>%
hc_add_theme(hc_theme_darkunica())Bar Graph #2
The following bar graph plots the danceability of all tracks sorted by the albums. The highcharter package was also used for this visualization, alongside pipe operators from the dplyr package. The function hchart actually helped create the graph, with the haes function serving to select the data and variables needed on our x and y axes as well as the color assignments to have the graph show color by the album name.
hchart(
spicegirls,
"bar",
hcaes(x = 'track_name', y = 'danceability', group = album_name, fill = 'album_name'))%>%
hc_title(text = "Spice Girls Tracks by Danceability")%>%
hc_xAxis(title = list(text = "Track Name"))%>%
hc_yAxis(title = list(text = "Danceability"))%>%
hc_subtitle(text = "<b>3470 Project 1<b>") %>%
hc_legend(align = "right", verticalAlign = "top",
layout = "vertical", x = 0, y = 100)%>%
hc_add_theme(hc_theme_darkunica())Conclusions
Based on our scatterplot, the valence of tracks does not seem to hit a peak point on any certain album. However, the album, “Spice” does show a center focused and regulated valence level, maintaining around the 0.8 region. Both albums “Forever” and “Spiceworld” had valence values ranging from very low, to almost 1.0. Overall, this valence value does not seem to show any significant different between the albums, and indicates that there was not much of a valence difference by album.
In terms of our bar graph, this indicates that energy level increased over time by album. With a very high peak from the song, “Denying”, in the third album, “Spiceworld”.
The last graph visualizes the danceability among each track by the Spice Girls, also sorted by album name. This visualization is interesting, because in the previous bar graph
Overall, based on these visualizations, it seems as though the energy level of Spice Girls tracks increased by album, with “SpiceWorld” reaching the peak energy level of 150. The album, “Spice”, seems to have a generally regulated energy value, with a small interval of ranges, mostly landing between 75 and 100. The album, “Forever”, however, is the most diverse, with tracks ranging from 6 to an energy level of 97.