Skip to content

Commit

Permalink
Merge branch 'master' into posteam-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcaseb authored Sep 11, 2023
2 parents ee4c346 + ff8a7b5 commit fbe5392
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: nflfastR
Title: Functions to Efficiently Access NFL Play by Play Data
Version: 4.5.1.9010
Version: 4.5.1.9011
Authors@R:
c(person(given = "Sebastian",
family = "Carl",
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Added the new function `save_raw_pbp()` which efficiently downloads raw play-by-play data and saves it to the local file system. This serves as a helper to setup the system for faster play-by-play parsing via the above functionality. (#423)
- Added the new function `missing_raw_pbp()` that computes a vector of game IDs missing in the local raw play-by-play directory. (#423)
- Decode player IDs in 2023 pbp. (#425)
- Drop the pseudo plays TV Timeout and Two-Minute Warning. (#426)


# nflfastR 4.5.1
Expand Down
5 changes: 5 additions & 0 deletions R/helper_scrape_nfl.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ get_pbp_nfl <- function(id,
.predicate = is.character,
.funs = ~dplyr::na_if(.x, "")
) %>%
# Data in 2023 pbp introduced separate "plays" for TV timeouts and two minute warnings
# These mess up some of our logic. Since they are useless, we remove them here
dplyr::filter(
!(is.na(.data$timeout_team) & stringr::str_detect(tolower(.data$play_description), "timeout at|two-minute"))
) %>%
fix_posteams()

# fix for games where home_team == away_team and fields are messed up
Expand Down
Binary file modified tests/testthat/expected_pbp.rds
Binary file not shown.

0 comments on commit fbe5392

Please sign in to comment.