Skip to content

Commit

Permalink
Development branch (#321)
Browse files Browse the repository at this point in the history
* Fixing Pre-2002 data bug in fg_batter_leaders function  (#320)

* Update fg_pitcher_leaders.R

Removed variable renaming line that was breaking the function

* Update fg_batter_leaders.R

Removed renaming line that was breaking the function when used for years < 2002 due to fangraphs' addition of pitch f/x data

* update tests

---------

Co-authored-by: williamohandley <149746808+williamohandley@users.noreply.github.com>
  • Loading branch information
saiemgilani and williamohandley authored Jan 9, 2024
1 parent 840a8f8 commit 45269e2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion R/fg_batter_leaders.R
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ fg_batter_leaders <- function(
"wRC_plus" = "wRC+",
"WPA_minus" = "-WPA",
"WPA_plus" = "+WPA",
"FBall_pct" = "FB_pct1",
"AgeRng" = "AgeR",
"team_name" = "TeamName",
"team_name_abb" = "TeamNameAbb") %>%
Expand Down
3 changes: 1 addition & 2 deletions R/fg_pitcher_leaders.R
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ fg_pitcher_leaders <- function(
"Relief_IP" = "Relief-IP",
"WPA_minus" = "-WPA",
"WPA_plus" = "+WPA",
"FBall_pct" = "FB_pct1",
"AgeRng" = "AgeR",
"team_name" = "TeamName",
"team_name_abb" = "TeamNameAbb") %>%
Expand Down Expand Up @@ -563,4 +562,4 @@ fg_pitcher_leaders <- function(
#' @return A data frame of pitcher data.
#' @keywords legacy
#' @export
fg_pitch_leaders <- fg_pitcher_leaders
fg_pitch_leaders <- fg_pitcher_leaders
2 changes: 1 addition & 1 deletion tests/testthat/test-fg_batter_leaders.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ cols <- c(
"PH",
"WPA_LI",
"Clutch",
"FBall_pct",
"FB_pct1",
"FBv",
"SL_pct",
"SLv",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-fg_pitcher_leaders.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cols <- c(
"Games",
"WPA_LI",
"Clutch",
"FBall_pct",
"FB_pct1",
"FBv",
"SL_pct",
"SLv",
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-statcast_leaderboards.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cols <- c(
"anglesweetspotpercent",
"max_hit_speed",
"avg_hit_speed",
"ev50",
"fbld",
"gb",
"max_distance",
Expand Down

0 comments on commit 45269e2

Please sign in to comment.