I split the gameDir into MLB.gids and nonMLB.gids. Then used nested if statements to decide which scrape method to apply. We can now scrape MLB and minor leagues (even in the same gid list.)
I tested all the following and they are working:
devtools::install_github("keberwein/pitchRx", force=T)
library(pitchRx)
# Example from the documentation.
data(nonMLBgids, package = "pitchRx")
aaa <- nonMLBgids[grepl("2011_06_01_[a-z]{3}aaa_[a-z]{3}aaa", nonMLBgids)]
dat <- scrape(game.ids = aaa)
# Example of non-MLB gids.
mixed_gids <- scrape(game.ids=c("gid_2010_06_01_lhvaaa_tolaaa_1", "gid_2010_06_02_albaaa_nasaaa_1"))
# Traditional usage behaves as expeted.
dat <- scrape(start = "2013-08-01", end = "2013-08-01")
https://github.com/cpsievert/pitchRx/issues/25
I split the
gameDir
intoMLB.gids
andnonMLB.gids
. Then used nestedif
statements to decide which scrape method to apply. We can now scrape MLB and minor leagues (even in the same gid list.)I tested all the following and they are working: