Learn R Programming

openWAR (version 0.2.2.9001)

getRunEx: getRunEx

Description

Find the Run Expectancy for a given state

Usage

getRunEx(data, drop.incomplete = TRUE, ...)

Arguments

data

an MLBAM dataset

drop.incomplete

a LOGICAL indicating whether incomplete innings (e.g. walk-off innings) should be excluded from the run expectancy model. Default is TRUE.

...

currently ignored

Value

A function that takes two arguments: baseCode and outs, and returns a run value

Details

Given a data set, returns a function giving the run expectancy for any base/out state

Examples

Run this code
# NOT RUN {
#Data from May 2013
data(May)
fit.rem = getRunEx(May)

fit.rem(0,0)
fit.rem(4,1)
# }

Run the code above in your browser using DataLab