Introduction

I will show case an approach to this data. My aim is to communicate what usage this data might have and for who, what tools I will use to bring ideas on how to further expand upon the product

This data is collected from Kaggel`s Tiktok Trending Videos and includes variables such as artist, song title, date, where access to further variables about artist and track is available, such as tempo, track key, speech, instrumental, etc.

#First Load the libraries needed for this project
library(dplyr)
library(tidyr)
library(GGally)
library(gridExtra)
library(factoextra)
library(FactoMineR)
library(plotly)
library(ggplot2)
#Importing Data
data_tiktok <- read.csv(file = "tiktok.csv")

Inspecting Data and Cleaning Data

tiktok_clean <- data_tiktok
#Data Structure
tiktok_clean$track_id <- as.factor(tiktok_clean$track_id)
tiktok_clean$track_name <- as.factor(tiktok_clean$track_name)
tiktok_clean$artist_id <- as.factor(tiktok_clean$artist_id)
tiktok_clean$artist_name <- as.factor(tiktok_clean$artist_name)
tiktok_clean$album_id <- as.factor(tiktok_clean$album_id)
tiktok_clean$playlist_id <- as.factor(tiktok_clean$playlist_id)
tiktok_clean$playlist_name <- as.factor(tiktok_clean$playlist_name)
tiktok_clean$genre <- as.factor(tiktok_clean$genre)
tiktok_clean$release_date <- as.Date(tiktok_clean$release_date, format= "%Y-%m-%d")
tiktok_clean$popularity<- as.numeric(tiktok_clean$popularity)
#Checking Missing Value
tiktok_clean %>% 
  is.na() %>% 
  colSums()
#>         track_id       track_name        artist_id      artist_name 
#>                0                0                0                0 
#>         album_id         duration     release_date       popularity 
#>                0                0              102                0 
#>     danceability           energy              key         loudness 
#>                0                0                0                0 
#>             mode      speechiness     acousticness instrumentalness 
#>                0                0                0                0 
#>         liveness          valence            tempo      playlist_id 
#>                0                0                0                0 
#>    playlist_name    duration_mins            genre 
#>                0                0                0
#Delete Columns because we dont need the informations
tiktok_clean <-tiktok_clean[,!(colnames(tiktok_clean) %in%c("track_id", "artist_id", "album_id", "playlist_id", "playlist_name", "danceability","key","loudness","mode","speechiness","acousticness", "instrumentalness", "liveness", "tempo" ))]
summary(tiktok_clean)
#>                        track_name                artist_name      duration     
#>  Don't Start Now            :  26   Doja Cat           :  92   Min.   : 43426  
#>  What You Know Bout Love    :  24   DJ Challenge X     :  64   1st Qu.:155866  
#>  drivers license            :  23   Megan Thee Stallion:  64   Median :186980  
#>  No Idea                    :  23   Eduardo Luzquiños :  60   Mean   :194429  
#>  OUT WEST (feat. Young Thug):  23   Gill the ILL       :  55   3rd Qu.:224284  
#>  Put Your Records On        :  22   Justin Bieber      :  52   Max.   :716206  
#>  (Other)                    :6605   (Other)            :6359                   
#>   release_date          popularity         energy          valence      
#>  Min.   :1971-11-26   Min.   :  0.00   Min.   :0.0237   Min.   :0.0331  
#>  1st Qu.:2018-06-22   1st Qu.: 44.00   1st Qu.:0.5040   1st Qu.:0.3720  
#>  Median :2020-02-23   Median : 64.00   Median :0.6210   Median :0.5430  
#>  Mean   :2018-04-26   Mean   : 57.65   Mean   :0.6245   Mean   :0.5473  
#>  3rd Qu.:2020-10-23   3rd Qu.: 76.00   3rd Qu.:0.7520   3rd Qu.:0.7350  
#>  Max.   :2021-06-04   Max.   :100.00   Max.   :0.9990   Max.   :0.9980  
#>  NA's   :102                                                            
#>  duration_mins                    genre     
#>  Min.   : 0.7238   _TIKTOK           :2539  
#>  1st Qu.: 2.5978   TIKTOK DANCE      :2582  
#>  Median : 3.1163   TIKTOK OPM        : 502  
#>  Mean   : 3.2405   TIKTOK PHILIPPINES:1123  
#>  3rd Qu.: 3.7381                            
#>  Max.   :11.9368                            
#> 

Exploratory Data Analysis

Variable Description

  • track_id : self explanatory
  • track_name : self explanatory
  • artist_id : self explanatory
  • artist_name : self explanatory
  • album_id : self explanatory
  • album_id : self explanatory
  • release_date : self explanatory
  • popularity: self explanatory
  • danceability : Danceability describes how suitable a track is for dancing based on a combination of musical elements including tempo, rhythm stability, beat strength, and overall regularity. A value of 0.0 is least danceable and 1.0 is most danceable.
  • energy : Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of intensity and activity. Typically, energetic tracks feel fast, loud, and noisy. For example, death metal has high energy, while a Bach prelude scores low on the scale. Perceptual features contributing to this attribute include dynamic range, perceived loudness, timbre, onset rate, and general entropy.
  • key : The estimated overall key of the track. Integers map to pitches using standard Pitch Class notation. E.g. 0 = C, 1 = C♯/D♭, 2 = D, and so on. If no key was detected, the value is -1.
  • loudness : The overall loudness of a track in decibels (dB). Loudness values are averaged across the entire track and are useful for comparing relative loudness of tracks. Loudness is the quality of a sound that is the primary psychological correlate of physical strength (amplitude). Values typical range between -60 and 0 db.
  • mode : Mode indicates the modality (major or minor) of a track, the type of scale from which its melodic content is derived. Major is represented by 1 and minor is 0.
  • speechiness : Speechiness detects the presence of spoken words in a track. The more exclusively speech-like the recording (e.g. talk show, audio book, poetry), the closer to 1.0 the attribute value. Values above 0.66 describe tracks that are probably made entirely of spoken words. Values between 0.33 and 0.66 describe tracks that may contain both music and speech, either in sections or layered, including such cases as rap music. Values below 0.33 most likely represent music and other non-speech-like tracks.
  • acousticness : A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0 represents high confidence the track is acoustic.
  • instrumentalness : Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are treated as instrumental in this context. Rap or spoken word tracks are clearly “vocal”. The closer the instrumentalness value is to 1.0, the greater likelihood the track contains no vocal content. Values above 0.5 are intended to represent instrumental tracks, but confidence is higher as the value approaches 1.0.
  • liveness : Detects the presence of an audience in the recording. Higher liveness values represent an increased probability that the track was performed live. A value above 0.8 provides strong likelihood that the track is live.
  • valence : A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a track. Tracks with high valence sound more positive (e.g. happy, cheerful, euphoric), while tracks with low valence sound more negative (e.g. sad, depressed, angry).
  • tempo : The overall estimated tempo of a track in beats per minute (BPM). In musical terminology, tempo is the speed or pace of a given piece and derives directly from the average beat duration
  • playlist_id : self explanatory
  • playlist_name : self explanatory
  • duration_mins : The duration of the track in minutes.
  • genre : Track genre
tiktok_pop <- tiktok_clean
head(tiktok_pop, 2)
tail(tiktok_pop, 2)
#show the Bottom 5 tiktok songs and tiktok artists with the most popularity
top<- tiktok_pop %>% 
  select(track_name, artist_name, popularity) %>% 
  arrange(track_name, desc(popularity)) %>% 
  filter(popularity < 30) %>% 
  head(5)
top
#show the top 6 tiktok songs and tiktok artists with the most popularity
pop<- tiktok_pop %>% 
  select(track_name, artist_name, popularity) %>% 
  arrange(track_name, desc(popularity)) %>% 
  filter(popularity > 90) %>% 
  head(20)
pop
top_art <- group_by(pop, artist_name)
top_art1<- dplyr::summarise(top_art, count=n())
top_art1<- arrange(top_art1, desc(count))
top_art2<- filter(top_art1, count>0)

#
grap_pop <- ggplot(top_art2, aes(x=reorder(artist_name,count), y=count))+
            geom_bar(aes(y=count, fill=artist_name), stat = "identity")+
            labs(x="Artists", y="Number of Songs",
                 title = "Popular Artist On Tiktok")+
  theme(legend.position = "none", axis.text.x = element_text(angle=20, hjust=1))
    
grap_pop

The results of the analysis when you want to know the most popular artists on Tiktok are Bella Poarch, Gra MX Myke Towers, Nio Gracia, The Weekend, Masked Wolf, and Tion Wayne. Tion Wayne is the best out of the 6 Artists

graphics::pie(xtabs(~ genre, tiktok_pop))

From the pie chart that has been made, it shows that the use of Tiktok Dance by the wider community is more dominant than Tiktok OPM, Tiktok Philippines, and _Tiktok

#Corelation
ggcorr(tiktok_pop, label = T)

We have several variables with strong correlation between them

tiktokgenre<-tiktok_pop %>% 
  select_if(is.numeric) %>%  
  group_by(tiktok_pop[, 9]) %>% 
  summarise_all(mean)
tiktokgenre$genre <- tiktokgenre$`tiktok_pop[, 9]`
tiktokgenre$`tiktok_pop[, 9]` <- NULL
tiktokgenre %>% ggplot(aes(popularity, energy, color = genre))+
  geom_point()

While every tracks have their own designated genre, with provided data, we could determine how close they are to each other based on their property

Conclusion

From the above analysis we can conclude.The top 2 popular genres are Tiktok Dance with the track_name Lay It Down Gmix - Main and Bartender (feat. Akon), The second most popular genre is the song performed by Rachel Platten and BLACKPINK. Popular artists on Tiktok are Tion Wayne, Masked Wolf, and The Weekend