Learn R Programming

fivethirtyeight (version 0.5.0)

fifa_audience: How To Break FIFA

Description

The raw data behind the story "How To Break FIFA" https://fivethirtyeight.com/features/how-to-break-fifa/.

Usage

fifa_audience

Arguments

Format

A data frame with 3652 rows representing guests and 6 variables:

country

FIFA member country

confederation

Confederation to which country belongs

population_share

Country's share of global population (percentage)

tv_audience_share

Country's share of global world cup TV Audience (percentage)

gdp_weighted_share

Country's GDP-weighted audience share (percentage)

Examples

Run this code
# NOT RUN {
# To convert data frame to tidy data (long) format, run:
library(dplyr)
library(tidyr)
library(stringr)
fifa_audience_tidy <- fifa_audience %>%
  gather(type, share, -c(country, confederation)) %>%
  mutate(type = str_sub(type, start=1, end=-7)) %>%
  arrange(country)
# }

Run the code above in your browser using DataLab