tests/testthat/test-bref_daily_pitcher.R

# 
# cols <- c(
#   "bbref_id", "season", "Name", "Age", "Level",
#   "Team", "G", "GS", "W", "L", "SV", "IP", "H",
#   "R", "ER", "uBB", "BB", "SO", "HR", "HBP",
#   "ERA", "AB", "X1B", "X2B", "X3B", "IBB", "GDP", 
#   "SF", "SB", "CS", "PO", "BF", "Pit", "Str", "StL", 
#   "StS", "GB.FB", "LD", "PU", "WHIP", "BAbip", "SO9", 
#   "SO.W", "SO_perc", "uBB_perc", "SO_uBB"
# )
# 
# test_that("Daily Pitcher logs Baseball-Reference", {
#   skip_on_cran()
#   skip_on_ci()
#   
#   x <- bref_daily_pitcher("2021-05-10", "2021-06-20")
#   
#   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.