Learn R Programming

mlbstats (version 0.1.0)

aera: Calculates adjusted earned run average (ERA+)

Description

Computes adjusted earned run average accounting for park factor and league era (compare with "era" which is the traditional formula for earned run average, "erc" which is the component earned run average, or "dice" which is the defense-independent component earned run average)

Usage

aera(er, ip, lera, home_rs, home_ra, home_r, road_rs, road_ra, road_r)

Arguments

er

Number of runs that did not occur as a result of errors or passed balls

ip

Number of innings pitched

lera

Average league ERA

home_rs

Number of pitcher's team runs scored at home park

home_ra

Number of pitcher's team runs allowed at home park

home_r

Total number of runs scored at home park

road_rs

Number of pitcher's team runs scored at away park

road_ra

Number of pitcher's team runs allowed at away park

road_r

Total number of runs scored at away park

Value

aera

Examples

Run this code
# NOT RUN {
aera(10, 5.5, 2.5, 8, 7, 15, 6, 4, 10) # for a pair of games (one away, one home)
# }

Run the code above in your browser using DataLab