nflverse / nflfastR

A Set of Functions to Efficiently Scrape NFL Play by Play Data
https://www.nflfastr.com/
Other
413 stars 50 forks source link

[BUG] Misassigned Fumbles on Play by Play Data #444

Open SPNE opened 9 months ago

SPNE commented 9 months ago

Is there an existing issue for this?

Have you installed the latest development version of the package(s) in question?

If this is a data issue, have you tried clearing your nflverse cache?

I have cleared my nflverse cache and the issue persists.

What version of the package do you have?

‘1.4.0’

Describe the bug

On complex plays, fumbles are miscalculated from the play by play data.

Reprex

pbp <- load_pbp(2023)
weekStats = calculate_player_stats(pbp, weekly = TRUE)
weekStats %>% 
  select(player_display_name, week,rushing_fumbles, rushing_fumbles_lost ) %>% 
  filter(player_display_name == 'Josh Allen' & week == 1) 

pbp %>% 
  filter(game_id == "2023_01_BUF_NYJ" & half_seconds_remaining == 295 & game_half == "Half2") %>% 
  select(desc)

weekStats %>% 
  select(player_display_name, week,rushing_fumbles, rushing_fumbles_lost ) %>% 
  filter(player_display_name == 'Justin Jefferson' & week == 2) 

pbp %>% 
  filter(game_id == "2023_02_MIN_PHI" & half_seconds_remaining == 41 & game_half == "Half1") %>% 
  select(desc)

Expected Behavior

Bills @ Jets Week 1: nflfastr has 1 fumbles and 1 lost fumble instead of expected 2 fumbles and 1 lost fumble Vikings @ Eagles Week 2: nflfastr has 1 fumble and 0 lost fumbles instead of expected 1 fumble and 1 lost fumbles

nflverse_sitrep

nflfastR    4.6.0   4.6.0   4.6.0.9000  dev
nflplotR    1.2.0   1.2.0   1.2.0.9003  dev
nflreadr    1.4.0   1.4.0   1.4.0.09    dev

Screenshots

No response

Additional context

Jets @ Bill Game: https://www.nfl.com/games/bills-at-jets-2023-reg-1?active-tab=stats https://www.espn.com/nfl/playbyplay/_/gameId/401547352

Vikings @ Eagles Game: https://www.nfl.com/games/vikings-at-eagles-2023-reg-2?active-tab=stats https://www.espn.com/nfl/boxscore/_/gameId/401547410

mrcaseb commented 9 months ago

Started looking into this. Here are the stats of the problematic play in the BUF game. Both, stat ID 53 and 52, trigger fumble = 1 That's not an easy fix. Requires the same setup as the multiple laterals thing

image
mrcaseb commented 9 months ago

Same problem in the MIN game

image