Import data
# csv file
data <- read_csv("data/myData.csv")
## Rows: 900 Columns: 15
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (11): country, city, stage, home_team, away_team, outcome, win_conditio...
## dbl (3): year, home_score, away_score
## date (1): date
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
data
## # A tibble: 900 × 15
## year country city stage home_…¹ away_…² home_…³ away_…⁴ outcome win_c…⁵
## <dbl> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> <chr>
## 1 1930 Uruguay Montevid… Grou… France Mexico 4 1 H <NA>
## 2 1930 Uruguay Montevid… Grou… Belgium United… 0 3 A <NA>
## 3 1930 Uruguay Montevid… Grou… Brazil Yugosl… 1 2 A <NA>
## 4 1930 Uruguay Montevid… Grou… Peru Romania 1 3 A <NA>
## 5 1930 Uruguay Montevid… Grou… Argent… France 1 0 H <NA>
## 6 1930 Uruguay Montevid… Grou… Chile Mexico 3 0 H <NA>
## 7 1930 Uruguay Montevid… Grou… Bolivia Yugosl… 0 4 A <NA>
## 8 1930 Uruguay Montevid… Grou… Paragu… United… 0 3 A <NA>
## 9 1930 Uruguay Montevid… Grou… Uruguay Peru 1 0 H <NA>
## 10 1930 Uruguay Montevid… Grou… Argent… Mexico 6 3 H <NA>
## # … with 890 more rows, 5 more variables: winning_team <chr>,
## # losing_team <chr>, date <date>, month <chr>, dayofweek <chr>, and
## # abbreviated variable names ¹home_team, ²away_team, ³home_score,
## # ⁴away_score, ⁵win_conditions
Plot data
data %>%
ggplot(aes(winning_team)) +
geom_bar()
