From b05711c2364785d7723ea838313a3a484e3597d6 Mon Sep 17 00:00:00 2001 From: Sebastian Carl Date: Fri, 22 Mar 2024 16:57:58 +0100 Subject: [PATCH] Fill punter info on blocked punts --- DESCRIPTION | 2 +- NEWS.md | 1 + R/helper_tidy_play_stats.R | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1b0667c8..0e6fb46b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: nflfastR Title: Functions to Efficiently Access NFL Play by Play Data -Version: 4.6.1.9007 +Version: 4.6.1.9008 Authors@R: c(person(given = "Sebastian", family = "Carl", diff --git a/NEWS.md b/NEWS.md index dc64c672..790523df 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,7 @@ - Fixed play description in some 1999 and 2000 games where the string "D.Holland" replaced the kick distance. (#459) - Fixed a problem where the `goal_to_go` variable was `FALSE` in actual goal to go situations. (#460) - Fixed a bug in `fixed_drive` and `fixed_drive_result` where the second weather delay in `2023_13_ARI_PIT` wasn't identified correctly. (#461) +- `punter_player_id`, and `punter_player_name` are filled for blocked punt attempts. (#463) # nflfastR 4.6.1 diff --git a/R/helper_tidy_play_stats.R b/R/helper_tidy_play_stats.R index 9d9cdb88..7ae3e615 100644 --- a/R/helper_tidy_play_stats.R +++ b/R/helper_tidy_play_stats.R @@ -23,6 +23,8 @@ sum_play_stats <- function(play_Id, stats) { row$punt_blocked <- 1 row$punt_attempt <- 1 row$kick_distance <- play_stats$yards[index] + row$punter_player_id <- play_stats$player.esbId[index] + row$punter_player_name <- play_stats$player.displayName[index] } else if (stat_id == 3) { row$first_down_rush <- 1 } else if (stat_id == 4) { @@ -1285,6 +1287,7 @@ sum_play_stats <- function(play_Id, stats) { row$extra_point_aborted <- 1 row$extra_point_attempt <- 1 } else if (stat_id == 402) { + # tackle for loss player information is recorded in stat id 120 NULL } else if (stat_id == 403) { row$defensive_two_point_attempt <- 1