The raw data behind the story "The Ultimate Halloween Candy Power Ranking" https://fivethirtyeight.com/features/the-ultimate-halloween-candy-power-ranking/.
candy_rankings
A data frame with 85 rows representing Halloween candy and 13 variables:
The name of the Halloween candy.
Does it contain chocolate?
Is it fruit flavored?
Is there caramel in the candy?
Does it contain peanuts, peanut butter or almonds?
Does it contain nougat?
Does it contain crisped rice, wafers, or a cookie component?
Is it a hard candy?
Is it a candy bar?
Is it one of many candies in a bag or box?
The percentile of sugar it falls under within the data set.
The unit price percentile compared to the rest of the set.
The overall win percentage according to 269,000 matchups.
See https://github.com/fivethirtyeight/data/tree/master/candy-power-ranking
# To convert data frame to tidy data (long) format, run: library(dplyr) library(tidyr) library(stringr) candy_rankings_tidy <- candy_rankings %>% pivot_longer(-c(competitorname, sugarpercent, pricepercent, winpercent), names_to = "characteristics", values_to = "present") %>% mutate(present = as.logical(present)) %>% arrange(competitorname)