Building an Expected Run Matrix with openWAR

Exploring Baseball Data with R

Last time , we learned how to download MLBAM GameDay data using the openWAR package. Specifically, we downloaded data from a single game and created some simple summaries.

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

Posted on May 5, 2014, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: