Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024_19_GB_PHI has different drive result with what on ESPN.com #506

Open
ak47twq opened this issue Jan 17, 2025 · 7 comments
Open

2024_19_GB_PHI has different drive result with what on ESPN.com #506

ak47twq opened this issue Jan 17, 2025 · 7 comments

Comments

@ak47twq
Copy link

ak47twq commented Jan 17, 2025

test<-pbp%>%
  filter(game_id=="2024_19_GB_PHI") %>%
  select(play_id,play_type,desc,fixed_drive,fixed_drive_result) %>%
  collect()

Image

while in ESPN play_by_play

https://www.espn.com/nfl/playbyplay/_/gameId/401671880

Image

I think the 1st drive which result was FUMBLE is missing in PBP data.

Is it on purpose or a bug?

@guga31bb
Copy link
Member

This is intentional (https://github.com/nflverse/nflfastR/blob/master/R/helper_add_fixed_drives.R#L17) but don't feel strongly here

To me it feels weird to call what the Packers had a drive if they never had the ball. If it were a recovered onsides kick would ESPN give them a drive?

@ak47twq
Copy link
Author

ak47twq commented Jan 17, 2025

they do not give a drive for recovered onside kick

https://www.espn.com/nfl/playbyplay/_/gameId/401547501

Image

@ak47twq
Copy link
Author

ak47twq commented Jan 17, 2025

i see your point. but still feels weird to me that 2024_19_GB_PHI starts with drive no. 2.
when i do drive chart myself. the pic looks strange.

Image

drive no. 1 is empty in the pic.

@mrcaseb
Copy link
Member

mrcaseb commented Mar 17, 2025

I would like to keep the logic as is since it's not really different from an onside kick. However, I understand that starting with drive no. 2 is weird. I see 51 games since 2001 that start with drive no. 2 after a fumbled kickoff or recovered onside kick to start the game. Maybe we can handle this specific situation and decrement fixed drive @guga31bb ?

@guga31bb
Copy link
Member

Fine with me!

@mrcaseb
Copy link
Member

mrcaseb commented Mar 17, 2025

I think we could use this logic with row == 2

# first observation of a half is also a new drive
new_drive = dplyr::if_else(.data$row == 1, 1, .data$new_drive),

Something along

new_drive = dplyr::if_else(.data$row == 2, 0, .data$new_drive)

@mrcaseb
Copy link
Member

mrcaseb commented Mar 17, 2025

I think we could use this logic with row == 2

nflfastR/R/helper_add_fixed_drives.R

Lines 90 to 91 in 7d53e07

first observation of a half is also a new drive

new_drive = dplyr::if_else(.data$row == 1, 1, .data$new_drive),
Something along

new_drive = dplyr::if_else(.data$row == 2, 0, .data$new_drive)

Actually if we do that, we end up with changing posteams and non changing fixed drive?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants