getRunEx: getRunEx

Description Usage Arguments Details Value Examples

View source: R/getRunEx.R

Description

Find the Run Expectancy for a given state

Usage

1
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

Details

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

Value

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

Examples

1
2
3
4
5
ds = data(MLBAM2013)
fit.rem = getRunEx(ds)

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

frogman141/openWAR documentation built on Dec. 20, 2021, 8:52 a.m.