{r} install.packages("tidyverse")
{r} library(tidyverse)
{r} df <- read_csv("Playlist - Clean.csv")
{r} head(df)
{r} df$Genre <- as.factor(df$Genre)
{r} df %>% count(df$Genre)
{r} Genre_counts <- df %>% count(Genre)
{r} Genre_counts <- Genre_counts %>% mutate(prob=n/sum(n)) Genre_counts
{r} Genre_counts$prob <- round(Genre_counts$prob, 2) Genre_counts
#4.5
{r} playlist<-sample_n(df, 10) playlist_genres<-playlist %>% count(Genre) playlist_genres<-playlist_genres %>% mutate(probabilties = n/sum(n)) playlist_genres
```{r} sample_n(df, 20) %>% count(Genre) %>% mutate(probability = round(n/sum(n), 2))
```{r}
sample_n(df, 30) %>% count(Genre) %>% mutate(probability = round(n/sum(n), 2))
```{r} sample_n(df, 40) %>% count(Genre) %>% mutate(probability = round(n/sum(n), 2))
```
#questions
#reflect