The opponents each team faces every week in a fantasy regular season. Returned in a tidy format where each row is a single team with an indication of home-away status. There are two rows per matchup, one for each team.

tidy_schedule(leagueId = ffl_id(), leagueHistory = FALSE, ...)

tidy_matchups(...)

Arguments

leagueId

Numeric league ID or ESPN fantasy page URL. Defaults to getOption("fflr.leagueId"). Function fails if no ID is found.

leagueHistory

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.

...

Additional queries passed to httr::GET(). Arguments are converted to a named list and passed to query alongside view.

Value

A data frame(s) of match opponents.

Examples

tidy_schedule(leagueId = "42654852")
#> # A tibble: 68 × 7
#>    seasonId matchupPeriodId matchupId teamId abbrev opponent isHome
#>       <int>           <int>     <int>  <int> <fct>  <fct>    <lgl> 
#>  1     2024               1         1      1 AUS    CHI      TRUE  
#>  2     2024               1         1      3 CHI    AUS      FALSE 
#>  3     2024               1         2      2 BOS    DEN      TRUE  
#>  4     2024               1         2      4 DEN    BOS      FALSE 
#>  5     2024               2         3      3 CHI    DEN      TRUE  
#>  6     2024               2         3      4 DEN    CHI      FALSE 
#>  7     2024               2         4      1 AUS    BOS      TRUE  
#>  8     2024               2         4      2 BOS    AUS      FALSE 
#>  9     2024               3         5      4 DEN    AUS      TRUE  
#> 10     2024               3         5      1 AUS    DEN      FALSE 
#> # ℹ 58 more rows