Building an Expected Run Matrix with openWAR
Most often, we’ll be interested in investigated data from many games. The function getData() will download data over any time interval in which you are interested. Let’s figure out how many home runs were hit on May 14th, 2013.
Visualizing the data
One nice aspect of the MLBAM data is that it contains an (x,y)-coordinate indicated the location of each batted ball hit into play. getData() returns a data.frame of class GameDayPlays. We have written plot.GameDayPlays() function for visualizing hit location data with a generic field overlaid.
Note that we have done some of the work to normalize the coordinates provided by MLBAM – though there is still more to be done.
In order to compute openWAR, we need…
View original post 570 more words