library(RCurl)
library(ggplot2)
The article (https://fivethirtyeight.com/videos/the-ultimate-halloween-candy-power-ranking/) highlights the mission to find the ultimate candy for trick-or-treaters based off aproval ratings from 8,371 different IP Addresses. The article begins their analysis by asking the public to vote on 269,000 randomly generated matchups of their ideal halloween candy. Everything then focuses on the ingredients and type of candy/chocolate in order to find what people enjoy the most!
data_link <- getURL("https://raw.githubusercontent.com/fivethirtyeight/data/master/candy-power-ranking/candy-data.csv")
data <- read.csv(text = data_link)
head(data)
I personally love chocolate with peanuts or almonds (Reeseās, Iām looking at you), so I wanted to see the general win percentage of the chocolates listed. I additionally changed the color of the bars if they have caramel or not, just to get a general idea of the preferences of the public.
nutty_candy <- subset(data, peanutyalmondy == 1)
nutty_candy
ggplot(nutty_candy, aes(y = competitorname, group = 1)) +
geom_bar(aes(x = winpercent, fill = caramel), stat = 'identity')
## Conclusion The final findings show that chocolate is a MUST HAVE, especially if it has crispiness and nuttiness. Expansions to this study would include an increased population. The article mentioned that this study was taken online. Demographics / social status might have an effect on candy preferences. A poll found on facebook might have results that vary from a poll on CNN. One of the findings that I can take away from this article is that myself and an overwhelming percentage of people love Reeseās!!!