tests/testthat/test-fg_pitcher_gamelogs.R

cols <- c(
  "PlayerName",
  "playerid",
  "Date",
  "Opp",
  "teamid",
  "season",
  "Team",
  "HomeAway",
  "Age",
  "W",
  "L",
  "ERA",
  "G",
  "GS",
  "CG",
  "ShO",
  "SV",
  "HLD",
  "BS",
  "IP",
  "TBF",
  "H",
  "R",
  "ER",
  "HR",
  "BB",
  "IBB",
  "HBP",
  "WP",
  "BK",
  "SO",
  "K/9",
  "BB/9",
  "H/9",
  "K/BB",
  "IFH%",
  "BUH%",
  "GB",
  "FB",
  "LD",
  "IFFB",
  "IFH",
  "BU",
  "BUH",
  "K%",
  "BB%",
  "K-BB%",
  "SIERA",
  "HR/9",
  "AVG",
  "WHIP",
  "BABIP",
  "LOB%",
  "FIP",
  "E-F",
  "xFIP",
  "ERA-",
  "FIP-",
  "xFIP-",
  "GB/FB",
  "LD%",
  "GB%",
  "FB%",
  "IFFB%",
  "HR/FB",
  "RS",
  "RS/9",
  "Balls",
  "Strikes",
  "Pitches",
  "WPA",
  "-WPA",
  "+WPA",
  "RE24",
  "REW",
  "pLI",
  "inLI",
  "gmLI",
  "exLI",
  "Pulls",
  "Games",
  "WPA/LI",
  "Clutch",
  "SD",
  "MD",
  "FB%1",
  "FBv",
  "SL%",
  "SLv",
  "CT%",
  "CTv",
  "CB%",
  "CBv",
  "CH%",
  "CHv",
  "XX%",
  "PO%",
  "wFB",
  "wSL",
  "wCT",
  "wCB",
  "wCH",
  "wFB/C",
  "wSL/C",
  "wCT/C",
  "wCB/C",
  "wCH/C",
  "O-Swing%",
  "Z-Swing%",
  "Swing%",
  "O-Contact%",
  "Z-Contact%",
  "Contact%",
  "Zone%",
  "F-Strike%",
  "SwStr%",
  "Pull",
  "Cent",
  "Oppo",
  "Soft",
  "Med",
  "Hard",
  "bipCount",
  "Pull%",
  "Cent%",
  "Oppo%",
  "Soft%",
  "Med%",
  "Hard%",
  "tERA",
  "GSv2",
  "Events",
  "gamedate",
  "dh"
)

test_that("FanGraphs Pitcher Game Logs", {
  skip_on_cran()
  
  x <- fg_pitcher_game_logs(playerid = 104, year = 2006)
  
  expect_equal(colnames(x), cols)
  expect_s3_class(x, "data.frame")
})

Try the baseballr package in your browser

Any scripts or data that you put into this service are public.

baseballr documentation built on April 1, 2023, 12:12 a.m.