This function returns a tidy dataframe of player scores based on league rules.

Unfortunately, Sleeper has deprecated their player stats endpoint from their supported/open API. Adding some nflfastr-based ideas to the pipeline for future iterations.

ff_playerscores(conn, ...)

# S3 method for flea_conn
ff_playerscores(conn, page_limit = NULL, ...)

# S3 method for mfl_conn
ff_playerscores(conn, season, week, ...)

# S3 method for sleeper_conn
ff_playerscores(conn, ...)

Arguments

conn

the list object created by ff_connect()

...

other arguments (currently unused)

page_limit

A numeric describing the number of pages to return - default NULL returns all available

season

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

week

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

Value

A tibble of historical player scoring

Methods (by class)

  • flea_conn: Fleaflicker: returns the season, season average, and standard deviation

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

  • sleeper_conn: Sleeper: Deprecated their open API endpoint for player scores

Examples

# \donttest{ conn <- fleaflicker_connect(2020, 312861) x <- ff_playerscores(conn, page_limit = 2) x
#> # A tibble: 60 x 8 #> player_id player_name pos team games score_total score_avg score_sd #> <int> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> #> 1 12894 Patrick Mahomes QB KC 15 520. 34.6 9.95 #> 2 13761 Josh Allen QB BUF 16 550. 34.4 10.4 #> 3 3452 Aaron Rodgers QB GB 16 542. 33.8 8.49 #> 4 13775 Lamar Jackson QB BAL 15 440. 29.4 6.65 #> 5 309 Tom Brady QB TB 16 488. 30.5 12.2 #> 6 13758 Baker Mayfield QB CLE 16 360. 22.5 11.4 #> 7 325 Drew Brees QB NO 12 300. 25.0 7.47 #> 8 12965 Alvin Kamara RB NO 15 359. 23.9 12.3 #> 9 11329 Stefon Diggs WR BUF 16 302. 18.8 7.97 #> 10 12197 Tyreek Hill WR KC 15 314. 20.9 11.4 #> # … with 50 more rows
# } # \donttest{ dlf_conn <- mfl_connect(2020, league_id = 37920) ff_playerscores(conn = dlf_conn, season = 2019, week = "YTD")
#> # A tibble: 597 x 8 #> season week player_id player_name pos team points isAvailable #> <dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> #> 1 2019 YTD 13593 Jackson, Lamar QB BAL 480.68 0 #> 2 2019 YTD 13130 McCaffrey, Christian RB CAR 469.20 0 #> 3 2019 YTD 12652 Thomas, Michael WR NOS 391.00 0 #> 4 2019 YTD 11244 Kelce, Travis TE KCC 369.80 0 #> 5 2019 YTD 12625 Elliott, Ezekiel RB DAL 355.70 0 #> 6 2019 YTD 12620 Prescott, Dak QB DAL 351.78 0 #> 7 2019 YTD 12626 Henry, Derrick RB TEN 351.60 0 #> 8 2019 YTD 13113 Watson, Deshaun QB HOU 342.08 0 #> 9 2019 YTD 10703 Wilson, Russell QB SEA 339.70 0 #> 10 2019 YTD 13319 Jones, Aaron RB GBP 337.90 0 #> # … with 587 more rows
# }