Learn R Programming

Sabermetrics (version 2.0)

iso: Isolated Power

Description

Isolated power measures a hitter's ability to hit for extra bases.

Usage

iso(slg, avg)

Arguments

slg
Slugging Percentage
avg
Batting Average

Value

Returns a numerical value equal to SLG-AVG

References

http://www.fangraphs.com/library/offense/iso/

See Also

opsplus, ops

Examples

Run this code
## Let's calculate Mike Trout's isolated power in 2014
## He had a SLG = .561 and an AVG = .287
## We should get .274
iso(.561,.287)

## The function is currently defined as
function (slg, avg) 
{
    iso <- slg - avg
    return(iso)
  }

Run the code above in your browser using DataLab