PitchRx – An R Library for Scraping, Analyzing and Visualizing PitchFX Data

If you’re a sabermetrics geek you’ll definitely want to check out Carson Sievert’s pitchRx package. You can scrape all PitchFX data since 2008, visualize strikezones, create interactive 3D pitch charts and a lot more. The below example pulls Jon Lester’s pitchFX data from May 4th, 2012 against the Baltimore Orioles and visualizes the locations of the pitches he threw as they crossed home plate.

LesterPitchesLR

I also used this library to scrape all of PitchFX data from 2008-2012 and am going to import it into a local database so I can query it quickly and easily. For a great introduction and overview of this library, check out Carson’s demo here: http://cpsievert.github.io/pitchRx/demo/.

Comments (6)

  1. Glad to see pitchRx out in the wild! You could actually do without the “grepping” of urls and go straight to subsetting pitchFX via pitcher_name (I doubt there was another Jon Lester pitching that day). You could also do without facetting by pitcher_name (ie, facets <- facet_grid(.~stand))

Pingbacks list

  1. Pingback: PitchRx – An R Library for Scraping, Analyzing and Visualizing PitchFX Data | Sports Data Viz | R for Journalists | Scoop.it

  2. Pingback: PitchRx – An R Library for Scraping, Anal...

  3. Pingback: Boston Predictive Analytics Group | DataRemixed

Leave a reply for Carson Sievert Cancel comment