# NOT RUN {
# To convert data frame to tidy data (long) format, run:
library(dplyr)
library(tidyr)
library(stringr)
fifa_audience_tidy <- fifa_audience %>%
pivot_longer(-c(country, confederation),
names_to = "type", values_to = "share") %>%
mutate(type = str_sub(type, start=1, end=-7)) %>%
arrange(country)
# }
Run the code above in your browser using DataLab