Closed RileyJohnson22 closed 1 year ago
Fixed in #431
nflreadr::load_pbp() |>
nflfastR::calculate_player_stats(weekly = TRUE) |>
dplyr::filter(player_name == "T.Lawrence") |>
dplyr::select(
player_id, player_name, week, opponent_team, tidyselect::contains("fumble")
) |>
dplyr::glimpse()
#> Rows: 1
#> Columns: 10
#> $ player_id <chr> "00-0036971"
#> $ player_name <chr> "T.Lawrence"
#> $ week <int> 1
#> $ opponent_team <chr> "IND"
#> $ sack_fumbles <int> 1
#> $ sack_fumbles_lost <int> 0
#> $ rushing_fumbles <dbl> 0
#> $ rushing_fumbles_lost <dbl> 0
#> $ receiving_fumbles <dbl> 0
#> $ receiving_fumbles_lost <dbl> 0
Is there an existing issue for this?
Have you installed the latest development version of the package(s) in question?
What version of the package do you have?
4.5.1
Describe the bug
In the current code for sack_fumbles_lost in nflfastr::calculate_player_stats(), it calculates: sack_fumbles_lost = [sum](.data$fumble_lost == 1 & .data$fumbled_1_player_id == .data$passer_player_id) I would suggest a check in here of whether fumble_recovery_1_team is different than the player who fumbled in here. .data$fumbled_1_team!=.data$fumble_recovery_1_team Statistically, the lost fumble should only be charged to Bigsby. This is of course not a common occurrence but could be applied to rushing fumbles and receiving fumbles as well
Reprex
Expected Behavior
I would expect 0 for sack_fumbles_lost
nflverse_sitrep
Screenshots
No response
Additional context
No response