Skip to contents

This function returns a tidy dataframe of team rosters

Usage

ff_rosters(conn, ...)

# S3 method for espn_conn
ff_rosters(conn, week = NULL, ...)

# S3 method for flea_conn
ff_rosters(conn, ...)

# S3 method for mfl_conn
ff_rosters(conn, custom_players = deprecated(), week = NULL, ...)

# S3 method for 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

"[Deprecated]" - now returns custom players by default

Value

A tidy dataframe of rosters, joined to basic player information and basic franchise information

Methods (by class)

  • espn_conn: ESPN: Returns all roster data.

  • flea_conn: Fleaflicker: Returns roster data (minus age as of right now)

  • mfl_conn: MFL: returns roster data

  • 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
#> # … with 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    SF    676a508c-c65…
#>  3      1578553 Running Bear       14736 Devin Single… RB    BUF   a961b0d4-5d7…
#>  4      1578553 Running Bear       13772 Rashaad Penny RB    SEA   2b119688-83b…
#>  5      1578553 Running Bear       12017 Laquon Tread… WR    JAC   2e0badcd-b78…
#>  6      1578553 Running Bear       15531 Brandon Aiyuk WR    SF    c90471cc-fa6…
#>  7      1578553 Running Bear       13788 Michael Gall… WR    DAL   9e174ff2-ca0…
#>  8      1578553 Running Bear       15564 Van Jefferson WR    LAR   8e1285f7-6e4…
#>  9      1578553 Running Bear       16250 Ja'Marr Chase WR    CIN   fa99e984-d63…
#> 10      1578553 Running Bear       12972 Gerald Evere… TE    LAC   ebeceb00-57e…
#> # … with 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
#>    <chr>        <chr>          <chr>     <chr>                 <chr> <chr> <dbl>
#>  1 0001         Team Pikachu   13189     Engram, Evan          TE    NYG    27.8
#>  2 0001         Team Pikachu   11680     Landry, Jarvis        WR    CLE    29.6
#>  3 0001         Team Pikachu   13645     Smith, Tre'Quan       WR    NOS    26.5
#>  4 0001         Team Pikachu   12110     Brate, Cameron        TE    TBB    31  
#>  5 0001         Team Pikachu   13168     Reynolds, Josh        WR    LAR    27.3
#>  6 0001         Team Pikachu   13793     Valdes-Scantling, Ma… WR    GBP    27.7
#>  7 0001         Team Pikachu   13377     Patrick, Tim          WR    DEN    28.6
#>  8 0001         Team Pikachu   13254     Shaheen, Adam         TE    MIA    28.5
#>  9 0001         Team Pikachu   14803     Edwards-Helaire, Cly… RB    KCC    23.2
#> 10 0001         Team Pikachu   14838     Shenault, Laviska     WR    JAC    23.7
#> # … with 407 more rows, and 4 more variables: roster_status <chr>,
#> #   drafted <chr>, draft_year <chr>, 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     32.6
#>  2 1            Fake News      1339      Zach Ertz       TE    ARI    31.6
#>  3 1            Fake News      1426      DeAndre Hopkins WR    ARI    30  
#>  4 1            Fake News      1825      Jarvis Landry   WR    NO     29.6
#>  5 1            Fake News      2025      Albert Wilson   WR    MIN    29.9
#>  6 1            Fake News      2197      Brandin Cooks   WR    HOU    28.7
#>  7 1            Fake News      2319      DeVante Parker  WR    NE     29.4
#>  8 1            Fake News      232       Frank Gore      RB    NA     39.1
#>  9 1            Fake News      2822      Adam Humphries  WR    NA     29  
#> 10 1            Fake News      289       Drew Brees      QB    NA     43.4
#> # … with 340 more rows
# }