# NOT RUN {
# To convert data frame to tidy data (long) format, run:
library(dplyr)
library(tidyr)
library(stringr)
candy_rankings_tidy <- candy_rankings %>%
gather(characteristics, present, -c(competitorname, sugarpercent, pricepercent, winpercent)) %>%
mutate(present = as.logical(present)) %>%
arrange(competitorname)
# }
Run the code above in your browser using DataLab