-
Notifications
You must be signed in to change notification settings - Fork 51
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
[BUG] Problematic fixed_drive behavior linked to erroneous changes in posteam #496
Comments
Some initial thoughts on this:
|
Oh and the first drive of |
So here is code to filter down to relevant games pbp_db |>
filter(season >= 2001, is.na(fixed_drive_result), desc != "GAME") |>
filter(n() > 1, .by = game_id) |>
select(game_id, play_id, posteam, fixed_drive, desc) |>
collect() |>
gt(groupname_col = "game_id") |>
tab_options(
row_group.background.color = "gray"
) |
The 2002 TEN OAK game is just two return TDs followed by some random play description with swapped posteam. We can ignore this. So it comes down to |
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?
4.6.1.9020
Describe the bug
Summary
fixed_drive
seems to be incremented in cases where it should not be (consecutive timeouts, other misc. instances), likely because of erroneous changes inposteam
. This leads to NA values infixed_drive_result
.I discovered these instances in running this code:
There are 134 instances in which
fixed_drive_result
is NA, which seems like something that shouldn't really be happening. Some situations that seem to result in this:Consecutive Timeouts
posteam
, andfixed_drive
is incremented to 25. That seems correct. Butfixed_drive_result
is NA, which is odd because the drive ends in a turnover on downs.posteam
is empty which presumably promptsfixed_drive
to be incremented?posteam
is back to MIN andfixed_drive
is incremented again, and nowfixed_drive_result
is correct.Not sure how
fixed_drive
works but I suspect that if it's based on changes inposteam
, then the empty string in row 8 messes it up.Another example:
The first of two consecutive timeouts again has
posteam
as an empty string which leads tofixed_drive
being incremented, and plays within the same drive hasfixed_drive
values of 8 and 10, and half of the drive doesn't have afixed_drive_result
value.Miscellaneous
fixed_drive
seems to correctly be 22.posteam
is switched to CAR, which results infixed_drive
incrementing.posteam
is again CLE (sofixed_drive
increments again) and Cleveland punts.fixed_drive_result
is thus Punt.Rows 6-12 should probably all have
fixed_drive
set to 22 andfixed_drive_result
set to Punt, but the review at row 11 seems to mess things up.Another example:
fixed_drive
14,posteam
PHI fumbles and LA recovers.fixed_drive
is incremented andposteam
is set to LA - this is right.posteam
is set to PHI, despite it being the same drive.fixed_drive
, it increments again on the next row whenposteam
is again LA, andfixed_drive_result
for previous rows is NA when it should be Field goal.Reprex
Expected Behavior
Seems like
posteam
should not be changing within these drives, which would keepfixed_drive
consistent throughout the drivenflverse_sitrep
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: