From f2e34bf6e393a4933966018551a685e33c68c126 Mon Sep 17 00:00:00 2001 From: Tan Ho <38083823+tanho63@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:06:54 -0400 Subject: [PATCH] Fix pbp_pass YAC, closes #19 --- DESCRIPTION | 5 ++--- NEWS.md | 1 + R/ep_preprocess.R | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c8856ae..06e8f16 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,9 @@ Package: ffopportunity Title: Models for Fantasy Football Expected Points -Version: 0.1.0.06 +Version: 0.1.0.07 Authors@R: c( person("Joe", "Sydlowski", , "syd235@gmail.com", role = c("aut", "cre", "cph")), - person("Tan", "Ho", , "tan@tanho.ca", role = "aut", - comment = c(ORCID = "0000-0001-8388-5155")) + person("Tan", "Ho", , "tan@tanho.ca", role = "aut", comment = c(ORCID = "0000-0001-8388-5155")) ) Description: Downloads expected fantasy points data from 'ffverse' repositories if available, and otherwise builds up expected points diff --git a/NEWS.md b/NEWS.md index aef7ae7..47b5e9c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,3 +9,4 @@ * Combine variants of ep_load into one function `ep_load()` with arguments * Rename to ffopportunity * Include spikes and kneel downs to tie out to official stats with `ep_summarize()` +* Fix YAC bug in pbp_pass data \ No newline at end of file diff --git a/R/ep_preprocess.R b/R/ep_preprocess.R index 544f08e..c5aed1d 100644 --- a/R/ep_preprocess.R +++ b/R/ep_preprocess.R @@ -72,8 +72,7 @@ ep_preprocess <- function(pbp){ stringr::str_detect(.data$desc, " right") ~ "right", stringr::str_detect(.data$desc, " middle") ~ "middle", TRUE ~ "unk"), - yards_after_catch = dplyr::if_else( - .data$two_point_attempt == 1,0, .data$xpass), + yards_after_catch = dplyr::if_else(.data$two_point_attempt == 1, 0, .data$yards_after_catch), air_yards = dplyr::if_else( .data$two_point_attempt == 1, .data$yardline_100, .data$air_yards), two_point_converted = dplyr::case_when(