Skip to contents

This function returns a tidy dataframe with one row for every starter (and bench) for every week and their scoring, if available.

Usage

ff_starters(conn, ...)

# S3 method for espn_conn
ff_starters(conn, weeks = 1:17, ...)

# S3 method for flea_conn
ff_starters(conn, week = 1:17, ...)

# S3 method for mfl_conn
ff_starters(conn, week = 1:17, season = NULL, ...)

# S3 method for sleeper_conn
ff_starters(conn, week = 1:17, ...)

Arguments

conn

the list object created by ff_connect()

...

other arguments (currently unused)

weeks

which weeks to calculate, a number or numeric vector

week

a numeric or one of YTD (year-to-date) or AVG (average to date)

season

the season of interest - generally only the most recent 2-3 seasons are available

Value

A tidy dataframe with every player for every week, including a flag for whether they were started or not

Methods (by class)

  • espn_conn: ESPN: returns who was started as well as what they scored.

  • flea_conn: Fleaflicker: returns who was started as well as what they scored.

  • mfl_conn: MFL: returns the player fantasy scores for each week (not the actual stats)

  • sleeper_conn: Sleeper: returns only "who" was started, without any scoring/stats data. Only returns season specified in initial connection object.

Examples

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- espn_connect(season = 2020, league_id = 1178049)
  ff_starters(conn, weeks = 1:3)
}) # end try
#> # A tibble: 714 × 12
#>     week franchi…¹ franc…² franc…³ lineu…⁴ playe…⁵ proje…⁶ playe…⁷ playe…⁸ pos  
#>    <int>     <int> <chr>     <dbl> <chr>     <dbl>   <dbl>   <int> <chr>   <chr>
#>  1     1         1 Rushin…     118 QB         27.5    22.5 3916387 Lamar … QB   
#>  2     1         1 Rushin…     118 RB          9.2    13.6 3068267 Austin… RB   
#>  3     1         1 Rushin…     118 RB          6.7     8   3060022 Jordan… RB   
#>  4     1         1 Rushin…     118 WR         13.1    14.3 3116406 Tyreek… WR   
#>  5     1         1 Rushin…     118 WR          8.6    10.7 3121422 Terry … WR   
#>  6     1         1 Rushin…     118 WR         12.6     9.8 4241372 Marqui… WR   
#>  7     1         1 Rushin…     118 TE         16.6     8   4036131 Noah F… TE   
#>  8     1         1 Rushin…     118 DST         0       5.2  -16006 Cowboy… DST  
#>  9     1         1 Rushin…     118 K           9       7.4 2473037 Jason … K    
#> 10     1         1 Rushin…     118 BE          4.8     6.3   15920 Latavi… RB   
#> # … with 704 more rows, 2 more variables: team <chr>,
#> #   eligible_lineup_slots <list>, and abbreviated variable names ¹​franchise_id,
#> #   ²​franchise_name, ³​franchise_score, ⁴​lineup_slot, ⁵​player_score,
#> #   ⁶​projected_score, ⁷​player_id, ⁸​player_name
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  conn <- fleaflicker_connect(season = 2020, league_id = 206154)
  ff_starters(conn)
}) # end try
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  dlf_conn <- mfl_connect(2020, league_id = 37920)
  ff_starters(conn = dlf_conn)
}) # end try
#> # A tibble: 6,371 × 11
#>    franchis…¹ franc…² season  week start…³ shoul…⁴ playe…⁵ playe…⁶ playe…⁷ pos  
#>    <chr>      <chr>    <dbl> <int> <chr>     <dbl>   <dbl> <chr>   <chr>   <chr>
#>  1 0013       Advanc…   2020     1 starter       1    30.3 14056   Murray… QB   
#>  2 0013       Advanc…   2020     1 starter       1    21.7 13132   Kamara… RB   
#>  3 0013       Advanc…   2020     1 starter       1    27.1 12447   Moster… RB   
#>  4 0013       Advanc…   2020     1 starter       1    13   13668   Chark,… WR   
#>  5 0013       Advanc…   2020     1 starter       1     9.6 14833   Jeudy,… WR   
#>  6 0013       Advanc…   2020     1 starter       1    13.4 14280   Miller… WR   
#>  7 0013       Advanc…   2020     1 starter       1     9.7 12176   Parker… WR   
#>  8 0013       Advanc…   2020     1 starter       1     9.3 13680   Hurst,… TE   
#>  9 0013       Advanc…   2020     1 starter       1    18.7 11647   Thomas… TE   
#> 10 0013       Advanc…   2020     1 nonsta…       0     8.1 13131   Mixon,… RB   
#> # … with 6,361 more rows, 1 more variable: team <chr>, and abbreviated variable
#> #   names ¹​franchise_id, ²​franchise_name, ³​starter_status, ⁴​should_start,
#> #   ⁵​player_score, ⁶​player_id, ⁷​player_name
# }

# \donttest{
try({ # try only shown here because sometimes CRAN checks are weird
  jml_conn <- sleeper_connect(league_id = "522458773317046272", season = 2020)
  ff_starters(jml_conn, week = 3)
}) # end try
#> # A tibble: 344 × 8
#>    franchise_id franchise_name  week starter_status player…¹ playe…² pos   team 
#>           <int> <chr>          <dbl> <chr>          <chr>    <chr>   <chr> <chr>
#>  1            1 Fake News          3 nonstarter     7082     Dalton… TE    NA   
#>  2            1 Fake News          3 nonstarter     6826     Cole K… TE    CHI  
#>  3            1 Fake News          3 nonstarter     6804     Jordan… QB    GB   
#>  4            1 Fake News          3 nonstarter     676      LeSean… RB    NA   
#>  5            1 Fake News          3 nonstarter     6149     Darius… WR    NYG  
#>  6            1 Fake News          3 nonstarter     6068     Devine… RB    DEN  
#>  7            1 Fake News          3 nonstarter     6001     Drew S… TE    CIN  
#>  8            1 Fake News          3 nonstarter     5965     Miles … WR    PIT  
#>  9            1 Fake News          3 nonstarter     5068     Kerryo… RB    NA   
#> 10            1 Fake News          3 nonstarter     5022     Dallas… TE    PHI  
#> # … with 334 more rows, and abbreviated variable names ¹​player_id, ²​player_name
# }