Skip to content

Instantly share code, notes, and snippets.

@cpsievert
Created July 7, 2014 19:10
Show Gist options
  • Save cpsievert/2816efc62b0a62f4f9ab to your computer and use it in GitHub Desktop.
Save cpsievert/2816efc62b0a62f4f9ab to your computer and use it in GitHub Desktop.
devtools::install_github("cpsievert/pitchRx")
library(pitchRx)
# All game IDs that do not contain "mlb" are included in nonMLBgids
# In order to grab non-MLB games, you *have to* use these IDs
data(nonMLBgids)
# Grab IDs for triple A games on June 1st, 2011
# This post explains more about obtaining game IDs with regular expressions --
# http://baseballwithr.wordpress.com/2014/06/30/pitchrx-meet-openwar-4/
aaa <- nonMLBgids[grepl("2011_06_01_[a-z]{3}aaa_[a-z]{3}aaa", nonMLBgids)]
dat <- scrape(game.ids = aaa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment