tests/testthat/test-fg_guts.R

cols <- c(
  "season", "lg_woba", "woba_scale", "wBB",
  "wHBP", "w1B", "w2B", "w3B", "wHR",
  "runSB", "runCS", "lg_r_pa", "lg_r_w", "cFIP"
)

test_that("FanGraphs GUTS Factors", {
  skip_on_cran()
  
  x <- fg_guts()
  
  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.