#Period 8 Music Data- Do the shuffled songs that play in class represent the genres in the whole playlist?
##We collected music data from the class by creating a group playlist full of 5-10 of our favorite songs. We then created 6 overall genres all the songs fell into. After that we cleaned up the data before importing in into positcloud. We made sure there were no duplicate songs and made sure every entry was entered correctly.
#checking the headers of the data
head(df)
##
## 1 function (x, df1, df2, ncp, log = FALSE)
## 2 {
## 3 if (missing(ncp))
## 4 .Call(C_df, x, df1, df2, log)
## 5 else .Call(C_dnf, x, df1, df2, ncp, log)
## 6 }
##Counting the number of songs in each genre in the playlist
head(data)
## # A tibble: 6 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 1 - hiphop/rap Alesso When I'm Gone
## 2 Genre 1 - hiphop/rap Aliyah's Interlude It Girl
## 3 Genre 1 - hiphop/rap Big Sean Beware
## 4 Genre 1 - hiphop/rap Clipse Ma, I don't love her
## 5 Genre 1 - hiphop/rap Common Be
## 6 Genre 1 - hiphop/rap Drake Nice for what
##Theoretical Probability of a Genre Getting Played on Shuffle Play
##G1-18% G2-15% G3-3% G4-30% G5-24% G6-10% <--(Rounded)
sampleTP<- sample_n(data,144)
sampleTP
## # A tibble: 144 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 1 - hiphop/rap Rod Wave Get Ready
## 2 Genre 1 - hiphop/rap Ken carson Murda musik
## 3 Genre 2 - pop/kpop/Latin J-Hope Safety Zone
## 4 Genre 4 - rnb/soul Brent faiyaz Forever yours
## 5 Genre 5 - alt/indie/folk Crumb Plants
## 6 Genre 4 - rnb/soul Giveon Still your best
## 7 Genre 5 - alt/indie/folk Cigarettes after sex Sunsetz
## 8 Genre 4 - rnb/soul sza snooze
## 9 Genre 2 - pop/kpop/Latin Alec Benjamin Devil Doesn't Bargain
## 10 Genre 4 - rnb/soul Jhene Aiko Stranger
## # ℹ 134 more rows
##Sample of 10 Shuffle Played Songs From Dataset
sample1<- sample_n(data,10)
sample1
## # A tibble: 10 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 3 - house/ska KAYTRANDA BUS RIDE
## 2 Genre 1 - hiphop/rap Aliyah's Interlude It Girl
## 3 Genre 5 - alt/indie/folk The Weather Machine Back O'er Oregon
## 4 Genre 4 - rnb/soul Lauryn Hill Tell Him
## 5 Genre 5 - alt/indie/folk Video Age Comic Relief
## 6 Genre 4 - rnb/soul Brent Faiyaz Missin Out
## 7 Genre 5 - alt/indie/folk AJR Burn The House Down
## 8 Genre 6 - country/rock Kacey Musgraves Die Fun
## 9 Genre 2 - pop/kpop/Latin Franglish Trop Parler
## 10 Genre 1 - hiphop/rap MF DOOM Doomsday
##G1-30% G2-10% G3-0% G4-30% G5-30% G6-0%
##Sample of 20 Shuffle Played Songs From Dataset
sample2<- sample_n(data,20)
sample2
## # A tibble: 20 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 2 - pop/kpop/Latin bad bunny Ojitos lindos
## 2 Genre 3 - house/ska Beyonce My house
## 3 Genre 5 - alt/indie/folk Taylor Swift Ivy
## 4 Genre 6 - country/rock Citizen Jet
## 5 Genre 3 - house/ska Tobias Dray Sunsets
## 6 Genre 4 - rnb/soul Brent faiyaz Rehab
## 7 Genre 4 - rnb/soul Thee sacred souls For now
## 8 Genre 5 - alt/indie/folk Cigarettes after sex Sunsetz
## 9 Genre 4 - rnb/soul Nelccia Options (clean version)
## 10 Genre 6 - country/rock Nirvana Man who sold the world mtv unp…
## 11 Genre 4 - rnb/soul Fountains of Wayne Halley's Waitress
## 12 Genre 2 - pop/kpop/Latin Taylor Swift The Man
## 13 Genre 5 - alt/indie/folk Aidan Bissett Tripping Over Air
## 14 Genre 1 - hiphop/rap Mac Miller Surf
## 15 Genre 5 - alt/indie/folk Nirvana Come As You Are
## 16 Genre 2 - pop/kpop/Latin Lana Del Rey Cinnamon Girl
## 17 Genre 5 - alt/indie/folk alkaline trio Scars
## 18 Genre 1 - hiphop/rap Jcole Crooked smile
## 19 Genre 4 - rnb/soul Fantasia When I see you
## 20 Genre 1 - hiphop/rap Clipse Ma, I don't love her
##G1-20% G2-5% G3-0% G4-45% G5-25% G6-5%
##Sample of 40 Shuffle Played Songs From Dataset
sample3<- sample_n(data,40)
sample3
## # A tibble: 40 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 5 - alt/indie/folk rilo kiley august
## 2 Genre 4 - rnb/soul Kieth Sweat Get up on it
## 3 Genre 1 - hiphop/rap Mac Miller Surf
## 4 Genre 4 - rnb/soul Solange Don't Touch My Hair
## 5 Genre 4 - rnb/soul Queen Naija Medicine
## 6 Genre 1 - hiphop/rap Jcole Crooked smile
## 7 Genre 5 - alt/indie/folk Video Age Comic Relief
## 8 Genre 4 - rnb/soul Mariah the Scientist From A Woman
## 9 Genre 4 - rnb/soul Amerie Can't Let Go
## 10 Genre 2 - pop/kpop/Latin ariana grande everytime
## # ℹ 30 more rows
## G1-25% G2-5% G3-2.5% G4-35% G5-17.5% G6-5%
##Sample of 80 Shuffle Played Songs From Dataset
sample4<- sample_n(data,80)
sample4
## # A tibble: 80 × 3
## genre artist title
## <chr> <chr> <chr>
## 1 Genre 6 - country/rock Dolly Parton 9 to 5
## 2 Genre 1 - hiphop/rap PnB Rock Selfish
## 3 Genre 2 - pop/kpop/Latin Taeyang Wedding dress
## 4 Genre 4 - rnb/soul Lauryn Hill Doo Wop
## 5 Genre 6 - country/rock Nirvana Come as you are
## 6 Genre 5 - alt/indie/folk laufey like the movies
## 7 Genre 1 - hiphop/rap Rod Wave Get Ready
## 8 Genre 5 - alt/indie/folk Nirvana Come As You Are
## 9 Genre 4 - rnb/soul Queen Naija Medicine
## 10 Genre 2 - pop/kpop/Latin ariana grande honeymoon avenue
## # ℹ 70 more rows
## G1-15% G2-16.25% G3-12.25% G4-27.5% G5-13.75% G6-12.25%
#Reflection ##On average, the larger the sample size used, the more accurate selection of genres was created.
##Sample 4 was the largest and most accurate sample compared to the theoretical probability except for genre 3 but theres always a margin of error in any sample.
##I learned how to analyze theoretical data vs sample data with the music data from in class and generated by posit cloud. I learned it from this whole process of creating and organizing data and graphs.
##Coding a simulation helped answer the unit question by having us create the visuals on our own and have us be engaged while thinking about it
#Coding Reflection
##The hardest part of coding for me was the part where we calculated the theoretical probability of genres being played. I think I missed the day or moment you went over that code so it was hard to catch up.
##I’m most proud of the generated samples of data because I figured it out with a classmate instead of only with a teacher.
##I’d like to learn more basic programming and theory because I was struggling with this project.
##I would reach out for help sooner if I couldn’t get code to work if I were to do this again.