Code Monkey home page Code Monkey logo

openwar's Introduction

Travis-CI Build Status

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. If it doesn't, try:

devtools::install_github("cboettig/Sxslt")

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

devtools::install_github("beanumber/openWAR")

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:

library(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

Please see our full paper on the arXiv or in the forthcoming issue of the Journal of Quantitative Analysis in Sports.

openwar's People

Contributors

beanumber avatar ctbrown avatar davidbmitchell avatar gjm112 avatar obarisk avatar znmeb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.