Get League Rosters
Source:R/0_generics.R
, R/espn_rosters.R
, R/flea_rosters.R
, and 2 more
ff_rosters.Rd
This function returns a tidy dataframe of team rosters
Usage
ff_rosters(conn, ...)
# S3 method for class 'espn_conn'
ff_rosters(conn, week = NULL, ...)
# S3 method for class 'flea_conn'
ff_rosters(conn, ..., week = NULL)
# S3 method for class 'mfl_conn'
ff_rosters(conn, custom_players = deprecated(), week = NULL, ...)
# S3 method for class 'sleeper_conn'
ff_rosters(conn, ...)
Arguments
- conn
a conn object created by
ff_connect()
- ...
arguments passed to other methods (currently none)
- week
a numeric that specifies which week to return
- custom_players
Value
A tidy dataframe of rosters, joined to basic player information and basic franchise information
Methods (by class)
ff_rosters(espn_conn)
: ESPN: Returns all roster data.ff_rosters(flea_conn)
: Fleaflicker: Returns roster data (minus age as of right now)ff_rosters(mfl_conn)
: MFL: returns roster dataff_rosters(sleeper_conn)
: Sleeper: Returns all roster data.
Examples
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
conn <- espn_connect(season = 2020, league_id = 899513)
ff_league(conn)
}) # end try
#> # A tibble: 1 × 16
#> league_id league_name season league_type franchise_count qb_type idp
#> <chr> <chr> <int> <chr> <int> <chr> <lgl>
#> 1 899513 Sucio Boys 2020 keeper 10 2QB/SF FALSE
#> # ℹ 9 more variables: scoring_flags <chr>, best_ball <lgl>, salary_cap <lgl>,
#> # player_copies <dbl>, years_active <chr>, qb_count <chr>, roster_size <int>,
#> # league_depth <dbl>, keeper_count <int>
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
joe_conn <- ff_connect(platform = "fleaflicker", league_id = 312861, season = 2020)
ff_rosters(joe_conn)
}) # end try
#> # A tibble: 348 × 7
#> franchise_id franchise_name player_id player_name pos team sportradar_id
#> <int> <chr> <int> <chr> <chr> <chr> <chr>
#> 1 1578553 Running Bear 12159 Dak Prescott QB DAL 86197778-8d4…
#> 2 1578553 Running Bear 16259 Trey Lance QB DAL 676a508c-c65…
#> 3 1578553 Running Bear 14736 Devin Single… RB NYG a961b0d4-5d7…
#> 4 1578553 Running Bear 13772 Rashaad Penny RB CAR 2b119688-83b…
#> 5 1578553 Running Bear 12017 Laquon Tread… WR FA 2e0badcd-b78…
#> 6 1578553 Running Bear 15531 Brandon Aiyuk WR SF c90471cc-fa6…
#> 7 1578553 Running Bear 13788 Michael Gall… WR LV 9e174ff2-ca0…
#> 8 1578553 Running Bear 15564 Van Jefferson WR PIT 8e1285f7-6e4…
#> 9 1578553 Running Bear 16250 Ja'Marr Chase WR CIN fa99e984-d63…
#> 10 1578553 Running Bear 12972 Gerald Evere… TE CHI ebeceb00-57e…
#> # ℹ 338 more rows
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
ssb_conn <- ff_connect(platform = "mfl", league_id = 54040, season = 2020)
ff_rosters(ssb_conn)
}) # end try
#> # A tibble: 417 × 11
#> franchise_id franchise_name player_id player_name pos team age drafted
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <chr>
#> 1 0001 Team Pikachu 13189 Engram, Evan TE NYG 29.7 3.04
#> 2 0001 Team Pikachu 11680 Landry, Jarv… WR CLE 31.5 4.02
#> 3 0001 Team Pikachu 13645 Smith, Tre'Q… WR NOS 28.4 18.02
#> 4 0001 Team Pikachu 12110 Brate, Camer… TE TBB 32.9 19.04
#> 5 0001 Team Pikachu 13168 Reynolds, Jo… WR LAR 29.3 20.02
#> 6 0001 Team Pikachu 13793 Valdes-Scant… WR GBP 29.6 21.04
#> 7 0001 Team Pikachu 13377 Patrick, Tim WR DEN 30.5 25.04
#> 8 0001 Team Pikachu 13254 Shaheen, Adam TE MIA 30.4 26.02
#> 9 0001 Team Pikachu 14803 Edwards-Hela… RB KCC 25.1 1.01
#> 10 0001 Team Pikachu 14838 Shenault, La… WR JAC 25.6 2.02
#> # ℹ 407 more rows
#> # ℹ 3 more variables: roster_status <chr>, draft_year <int>, draft_round <chr>
# }
# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
jml_conn <- ff_connect(platform = "sleeper", league_id = "522458773317046272", season = 2020)
ff_rosters(jml_conn)
}) # end try
#> # A tibble: 350 × 7
#> franchise_id franchise_name player_id player_name pos team age
#> <chr> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 1 Fake News 1110 T.Y. Hilton WR NA 34.5
#> 2 1 Fake News 1339 Zach Ertz TE WAS 33.5
#> 3 1 Fake News 1426 DeAndre Hopkins WR TEN 32
#> 4 1 Fake News 1825 Jarvis Landry WR NA 31.5
#> 5 1 Fake News 2025 Albert Wilson WR NA 31.9
#> 6 1 Fake News 2197 Brandin Cooks WR DAL 30.7
#> 7 1 Fake News 2319 DeVante Parker WR NA 31.4
#> 8 1 Fake News 232 Frank Gore RB NA 41
#> 9 1 Fake News 2822 Adam Humphries WR NA 30.9
#> 10 1 Fake News 289 Drew Brees QB NA 45.4
#> # ℹ 340 more rows
# }