Skip to contents

Calculate strength of schedule using team ratings and schedule, created using calculate_team_ratings() and get_fixtures()

Usage

calculate_sos(ratings, schedule)

Arguments

ratings

dataframe containing team and rating

schedule

dataframe containing team, opponent, and home_or_away

Value

returns a dataframe with two columns - team, sos

Examples

if (FALSE) {
remaining_schedule <-
  worldfootballR::fb_match_results(
    country = "ENG", gender = "M", season_end_year = 2024
    ) |>
  get_fixtures(remaining = TRUE)

team_ratings <-
  worldfootballR::fb_season_team_stats(
    country = "ENG", gender = "M", season_end_year = 2024,
    stat_type = "standard", tier = "1st"
    ) |>
  calculate_team_ratings()

calculate_sos(ratings = team_ratings, schedule = remaining_schedule)
}