Song Simulation

Jonny

```{r} df<-read_csv(“Class Playlist Clean DS4 - Sheet1.csv”)


First 5 genres of music

```{r}
head(df)

{r} df$Genre<-as.factor(df$Genre) df%>%count(Genre)

Based on this we can see that the majority of songs are hiphop/rap

{r} df%>%count(Genre) genre_counts<-df%>% count(Genre)

Data saved for access later

{r} genre_counts <- genre_counts %>% mutate(prob = n/sum(n)) genre_counts

Probability

{r} genre_counts<-genre_counts%>%mutate(prob=n/sum(n)) genre_counts

{r} genre_counts$prob<-round(genre_counts$prob,2) genre_counts

This final table shows us the probability of any Genre of music being played, the highest being Hiphop/rap with a 33% chance of being played, and alt/indie/folk with a 26% chance. Lowest probability is house/ska with only a 3% chance of being played.

We know this data is accurate because the numbers (.33, .14, .03, .08, .26, and .16 add up to 1- 100%)