{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE)
#Calculating Theoretical Probability ##EQ: How Likely is Each Genre?
Install the tidyverse package in the console below markdown.
{r} install.packages("tidyverse") Load the tidyverse
library into the markdown {r} library(tidyverse)
{r} df <- read_csv("playlist.csv") Count the Genres
{r} genres<-df%>%count(Genre) Mutate each Genre as a
new Column {r} genres%>%mutate( prob = n/105) Write an
interpretation of the numbers you calculated in your R Markdown.
The Top 3 Genres are country/rock, hiphop/rap, and alt/indie/folk with country/rock leading with a 0.26 probability. Based on these findings, I interpretate these numbers as how probable-or how high the change of picking it at random-a genre on the list is. Because country/rock is the most popular, it’s more probable to listen to a song of those genres in the class playlist.