knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(ussie)
library(dplyr)

The goal of ussie is to help you work with European Football League data. It uses data from the engsoccerdata package.

We can create a matches tibble using raw data from engsoccerdata:

matches_italy <- uss_make_matches(engsoccerdata::italy, "Italy")

glimpse(matches_italy)

We can also create a matches tibble using a country:

get_matches_italy <- uss_get_matches("italy")

glimpse(get_matches_italy)

We can add filtering conditions:

uss_get_matches("italy", season == 1934) |> glimpse()

We can get the final results for seasons:

italy_seasons <-
  get_matches_italy |>
  uss_make_teams_matches() |>
  uss_make_seasons_final() |>
  glimpse()

We can look at the effect of tiers on (wins - losses):

leeds_norwich <-
  uss_get_matches("england") |>
  uss_make_teams_matches() |>
  dplyr::filter(team %in% c("Leeds United", "Norwich City")) |>
  dplyr::mutate(tier = as.factor(tier)) |>
  uss_make_seasons_final() |>
  dplyr::arrange(team, season)

uss_plot_seasons_tiers(leeds_norwich, wins - losses)


ijlyttle/ussie documentation built on July 18, 2022, 9:43 a.m.