Skip to content
forked from beanumber/openWAR

An R package enabling the computation of openWAR using MLBAM data

Notifications You must be signed in to change notification settings

drbryan/openWAR

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenWAR

An open-source system for computing Wins Above Replacement

This package is designed to present a reference implementation of Wins Above Replacement for Major League Baseball players.

Installation

The Sxslt package is required in order to download new game data from MLBAM. This package is not present on CRAN. Hence, some manual installation may be necessary. The following command:

install.packages("Sxslt", repos = "http://www.omegahat.org/R", type = "source")

should do the trick.

Next, installing openWAR is best accomplished through the install_github() function in the devtools package.

require(devtools)
install_github("openWAR", "beanumber")

Data Source

The gameday() function downloads play-by-play data from the GameDay server hosted by Major League Baseball Advanced Media. This data is not libre, but it lives on a publicly-available webserver.

Getting individual game data is as simple as:

require(openWAR)
gd = gameday()
summary(gd)

To retrieve a data.frame of many games worth, try:

ds = getData()

This will retrieve play-by-play data for all games played yesterday (by default). For each play, 62 variables are recorded.

Methodology

About

An R package enabling the computation of openWAR using MLBAM data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 93.7%
  • XSLT 6.3%