Spotify is one of the most popular music streaming services, with more than half a billion users around the world. Getting the right music to the right people is essential to the success to the platform, so that users keep using the service. Because of this I have been hired by Spotify to identify music groups and genres that are the most popular, and find songs that fit the same criteria and statistics of those groups, so that they can be recommended by the people using the platform, thus increasing user retention.

The initial data has 23 variables, some of which list information of a song on the streaming service, such as name, release date, artist, as well as other variables that list related information like what album it was from or that albums release date. Other variables, such as energy, key, acousticness, instrumentalness, tempo, length, and liveliness list characteristics of the song.

##                 track_id               track_name             track_artist 
##                        0                        5                        5 
##         track_popularity           track_album_id         track_album_name 
##                        0                        0                        5 
## track_album_release_date            playlist_name              playlist_id 
##                        0                        0                        0 
##           playlist_genre        playlist_subgenre             danceability 
##                        0                        0                        0 
##                   energy                      key                 loudness 
##                        0                        0                        0 
##                     mode              speechiness             acousticness 
##                        0                        0                        0 
##         instrumentalness                 liveness                  valence 
##                        0                        0                        0 
##                    tempo              duration_ms 
##                        0                        0

Above, shows the variables with NA values, and upon further inspection it lists 5 rows (or songs) that have missing or incomplete data. These rows will be omitted.

Additionally, the variables that relate to albums: track album id, track album name, and track album release date, are somewhat unnecessary for our goal, so these will be omitted as well.

Here is the complete data set that will be used to gauge what songs are popular and what characteristics make it popular.

track_id track_name track_artist track_popularity playlist_name playlist_id playlist_genre playlist_subgenre danceability energy key loudness mode speechiness acousticness instrumentalness liveness valence tempo duration_ms
6f807x0ima9a1j3VPbc7VN I Don’t Care (with Justin Bieber) - Loud Luxury Remix Ed Sheeran 66 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.748 0.916 6 -2.634 1 0.0583 0.1020 0.00e+00 0.0653 0.518 122.036 194754
0r7CVbZTWZgbTCYdfa2P31 Memories - Dillon Francis Remix Maroon 5 67 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.726 0.815 11 -4.969 1 0.0373 0.0724 4.21e-03 0.3570 0.693 99.972 162600
1z1Hg7Vb0AhHDiEmnDE79l All the Time - Don Diablo Remix Zara Larsson 70 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.675 0.931 1 -3.432 0 0.0742 0.0794 2.33e-05 0.1100 0.613 124.008 176616
75FpbthrwQmzHlBJLuGdC7 Call You Mine - Keanu Silva Remix The Chainsmokers 60 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.718 0.930 7 -3.778 1 0.1020 0.0287 9.40e-06 0.2040 0.277 121.956 169093
1e8PAfcKUYoKkxPhrHqw4x Someone You Loved - Future Humans Remix Lewis Capaldi 69 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.650 0.833 1 -4.672 1 0.0359 0.0803 0.00e+00 0.0833 0.725 123.976 189052
7fvUMiyapMsRRxr07cU8Ef Beautiful People (feat. Khalid) - Jack Wins Remix Ed Sheeran 67 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.675 0.919 8 -5.385 1 0.1270 0.0799 0.00e+00 0.1430 0.585 124.982 163049
2OAylPUDDfwRGfe0lYqlCQ Never Really Over - R3HAB Remix Katy Perry 62 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.449 0.856 5 -4.788 0 0.0623 0.1870 0.00e+00 0.1760 0.152 112.648 187675
6b1RNvAcJjQH73eZO4BLAB Post Malone (feat. RANI) - GATTÜSO Remix Sam Feldt 69 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.542 0.903 4 -2.419 0 0.0434 0.0335 4.80e-06 0.1110 0.367 127.936 207619
7bF6tCO3gFb8INrEDcjNT5 Tough Love - Tiësto Remix / Radio Edit Avicii 68 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.594 0.935 8 -3.562 1 0.0565 0.0249 4.00e-06 0.6370 0.366 127.015 193187
1IXGILkPm0tOCNeq00kCPa If I Can’t Have You - Gryffin Remix Shawn Mendes 67 Pop Remix 37i9dQZF1DXcZDD7cfEKhW pop dance pop 0.642 0.818 2 -4.552 1 0.0320 0.0567 0.00e+00 0.0919 0.590 124.957 253040

Overall, all of these variables will be useful for determining the type of song that can be recommended to individuals that are interested in a certain style of music. track_popularity will be the variable that allows us to make our findings, as we can correlate characteristic and categorical variables to see what makes a song popular and which ones to recommend to users. Some characteristic variables are energy, acousticness, instrumentalness, and liveliness, which help to see what kind of track it is. The categorical variables, such as playlist_genre or track_artist, can help us find out if a recurring variable can be correlated with a higher popularity.

Depending on what I find from this data, I can see if certain variables are related, such as energy and tempo correlating to track_popularity. Additionally, I can create an entirely new categorical variable that consolidates speechiness, acousticness, and instrumentalness into one that tells you if the song has more vocals, instruments, or rhythm. Then I can use that variable to relate back to track_popularity to see if users prefer certain elements of a song. Box plots will help me see what values are outliers versus averages, and histograms can help to visualize if certain genres correlate to higher popularity.

To do this task, I must learn how to better use R Studio and its tools. I want to learn how to use multiple variables to see relations and commonalities. I also want to learn how to better use the visualization aspects of R Studio, such as box plots or histograms. If there are other forms of data visualization that I can use to relate back to track_popularity then I want to be aware of that so I can better solve this problem.