t <- read.csv(“C:/Users/banda/OneDrive/Desktop/stt/project.csv”)
jk <- t %>% arrange(desc(streams))
head(jk) tail(jk)
artist_streams <- t %>% group_by(artist.s._name) %>% summarise(total_streams = sum(streams, na.rm = TRUE)) %>% arrange(desc(total_streams))
bts_rank <- artist_streams %>% filter(artist.s._name == “BTS”)
bts_rank
plot(t\(released_day, t\)streams, main = “Spotify data”) plot(t\(streams, t\)released_month, pch = 21, bg = c(“purple”, “pink”, “green4”)[unclass(t\(artist_count)], main = "Spotify Data") plot(t\)released_year, t$streams, main = “Spotify data”)
hist(t$released_month, main = “Histogram”, xlab = “Released Month”, col = “pink”, border = “black”)
numeric_data <- jk[, sapply(jk, is.numeric)]
correlation_matrix <- cor(numeric_data)
heatmap(correlation_matrix, main = “Heatmap of Correlation Matrix”, xlab = “Variables”, ylab = “Variables”, col = heat.colors(12), symm = TRUE) # Select Top 20 Artists top_artists <- head(artist_streams, 20)
labels <- top_artists$artist.s._name
pie( top_artists$total_streams, labels = labels, main = “Top 20 Artists by Total Streams”, col = rainbow(20) ) # Select Top 5 Artists top5 <- head(artist_streams, 5)
barplot( top5\(total_streams, names.arg = top5\)artist.s._name, col = “skyblue”, main = “Top 5 Artists by Total Streams”, xlab = “Artist”, ylab = “Total Streams”, las = 2 # Make x-axis labels vertical )