The following packages were used in this analysis:
library(tidyverse)
library(ggplot2)
The dataset used for this analysis was originally obtained from Spotify using the spotifyr package. The data for this project was downloaded via this GitHub link. It contains 32,833 observations and 23 variables that are a mixture of categorical and numeric.
For this analysis, I wanted to see if the song tempo had any impact on the song popularity score. First, I created a new variable that categorized a song as having slow, regular or fast tempo. Slow songs have a tempo of 60 beats per minute (bpm) or less, fast songs have a tempo greater than 120 bpm, and regular songs fall between 61 and 120 bpm. The plot shows that the average popularity score for slow songs is less than that of fast and regular songs. Therefore, if the goal is to produce the next popular song, I would recommend that the tempo be faster than 60bpm.
#visualization
ggplot(data=spotify, aes(x=tempo_type, y=popularity))+
stat_summary(fun="mean", geom="bar")+
ggtitle("Tempo and Average Song Popularity")+
labs(y="Average Song Popularity", x = "Tempo Type")+
theme(plot.title = element_text(hjust = 0.5))