The score of each team in a matchup or scoring period and the match outcome.
tidy_scores(leagueId = ffl_id(), leagueHistory = FALSE, useMatchup = TRUE, ...)
Numeric league ID or ESPN fantasy page URL. Defaults to
getOption("fflr.leagueId")
. Function fails if no ID is found.
logical; Should the leagueHistory
version of the API
be called? If TRUE
, a list of results is returned, with one element for
each historical year of the league.
logical; Whether scoring should be summarized by
matchupPeriodId
(default) or scoringPeriodId
. The later always relates
to a single week of the NFL season, while fantasy matchups might span
several scoring periods, especially in the playoffs.
Additional queries passed to httr::GET()
. Arguments are
converted to a named list and passed to query
alongside view
.
A tidy data frame of scores by team and matchup/scoring period.
expectedWins
are calculated by comparing a team score against all other
scores for a given matchup period. This statistic expresses how a team would
fair if the schedule was random The highest scoring team is thus expected to
earn 1 win and the lowest scoring team would expect to win 0 matchups.
Other scoring functions:
live_scoring()
tidy_scores(leagueId = "42654852", useMatchup = FALSE)
#> No scores yet for this season
#> data frame with 0 columns and 0 rows