ffscrapr icon indicating copy to clipboard operation
ffscrapr copied to clipboard

ff_scoringhistory() and return fumbles for Sleeper

Open draftydesert277 opened this issue 4 years ago • 7 comments

Describe the bug Discovered when comparing aggregate ff_scoringhistory() results by team that ff_scoringhistory() appears to be ignoring return fumbles. This is a pretty obscure scoring thing that I think may be unique to Sleeper. See: https://support.sleeper.app/en/articles/4056849-why-did-my-player-lose-points-for-a-special-teams-fumble

Reprex Please provide a short, reproducible example of the code you are trying to run. For more on reprexes, check out https://reprex.tidyverse.org

 # Please include the code used for the connection object from `ff_connect()`

Expected behavior Return fumbles to hit ff_scoringhistory() same as any other fumble

Session information Please copy the output of sessionInfo() into the box below.


Screenshots If applicable, add screenshots to help explain your problem.

Additional context For reference, check out nflfastR data for Eagles/Rams, 2020. Cooper Kupp fumbled on a punt return, and I can verify that ff_scoringhistory() is 2.0 pts higher for my league than his official score in the Sleeper app.

draftydesert277 avatar May 09 '21 02:05 draftydesert277

Hm! That’s interesting. Will try to see if nflfastr has return fumbles

tanho63 avatar May 09 '21 02:05 tanho63

Hmm, it seems like they don’t have it, unfortunately: https://www.nflfastr.com/reference/calculate_player_stats.html

I’ll see if I can raise an issue and/or help fix it over there first and then can revisit this issue

tanho63 avatar May 09 '21 02:05 tanho63

Good news - they do! I was actually able to pull the fumble I referenced specifically. Not sure how easy this is to incorporate into existing functionality but check this out:

lar_phi <- nflfastR::build_nflfastR_pbp(game_ids = "2020_02_LA_PHI")

lar_phi <- filter(lar_phi, fumbled_1_player_id == "00-0033908")

lar_phi_t <- transpose(lar_phi)

Also I admit this is a bit of a hunch as I wasn't able to easily verify this for other games.

draftydesert277 avatar May 09 '21 03:05 draftydesert277

Hmm, it seems like they don’t have it, unfortunately: https://www.nflfastr.com/reference/calculate_player_stats.html

I’ll see if I can raise an issue and/or help fix it over there first and then can revisit this issue

Oh! I see it's an issue with their stat aggregation. I assumed you were doing some wizardry with the raw pbp data.

I suppose I could work around this by creating a separate dataset of just kick/fumble returns based on build_nflfastR_pbp()?

draftydesert277 avatar May 09 '21 03:05 draftydesert277

Yup, that’s definitely a way to get around it for now, I suspect that the nflfastr team would be happy to take in requests for these sort of aggregations

tanho63 avatar May 09 '21 03:05 tanho63

Tacked on a request at nflverse/nflfastR#235, when that gets resolved I can re-map here.

tanho63 avatar May 23 '21 15:05 tanho63

Brief update as of 2022-12-11: still pending on fumble recovery/fumble returns being included in nflreadr::load_player_stats(), at the moment this is still unscheduled. Also tracked in: nflverse/nflfastR#336.

tanho63 avatar Dec 12 '22 03:12 tanho63