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 14664 Kyler Murray QB ARI 10 375. 37.5 6.63 #> 2 13761 Josh Allen QB BUF 10 337. 33.7 10.6 #> 3 12919 Deshaun Watson QB HOU 10 304. 30.4 7.78 #> 4 12894 Patrick Mahomes QB KC 10 356. 35.6 11.1 #> 5 8598 Russell Wilson QB SEA 10 370. 37.0 10.1 #> 6 15516 Justin Herbert QB LAC 9 304. 33.8 7.15 #> 7 14668 Daniel Jones QB NYG 10 196. 19.6 6.64 #> 8 10240 Teddy Bridgewater QB CAR 10 246. 24.6 7.59 #> 9 5371 Matt Ryan QB ATL 10 254. 25.4 11.6 #> 10 10315 Derek Carr QB LV 10 245. 24.5 7.9 #> # … 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
# }