Skip to contents

Returns a ggplot:

  • season on the x-axis

  • faceted by team

  • has two layers:

    • rectangles shaded by tier

    • points showing some measure (default wins) on the y-axis

Of the countries included in uss_countries(), only "england" has data for more than one tier.

Usage

uss_plot_seasons_tiers(data_seasons, aes_y = .data$wins, ncol = 1)

Arguments

data_seasons,

data frame created using uss_make_seasons_final().

aes_y,

<data-masking> expression used for the y-aesthetic.

ncol,

integer-ish number of columns in facet.

Value

Object with S3 classes "gg", "ggplot", i.e. a ggplot2 object.

Examples

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

# use default (wins)
uss_plot_seasons_tiers(leeds_norwich)


# use custom expression
uss_plot_seasons_tiers(leeds_norwich, goals_for - goals_against)