The teams in a league and their owners.

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

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 dataframe (or list) with league teams.

Details

If any team has multiple owners, the memberId column will be a list of unique owner member ID strings per team (see league_members()).

Examples

league_teams(leagueId = "42654852")
#> # A tibble: 4 × 5
#>   abbrev teamId location nickname   memberId                              
#>   <fct>   <int> <chr>    <chr>      <chr>                                 
#> 1 AUS         1 Austin   Astronauts {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 2 BOS         2 Boston   Buzzards   {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 3 CHI         3 Chicago  Crowns     {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}
#> 4 DEN         4 Denver   Devils     {22DFE7FF-9DF2-4F3B-9FE7-FF9DF2AF3BD2}