Learn R Programming

Sabermetrics (version 2.0)

wrc: Weighted Runs Created

Description

Weighted Runs Created is a statistic which attempts to credit a hitter for the value of each outcome.

Usage

wrc(wOBA, PA, year)

Arguments

wOBA
Weighted On Base Average
PA
Plate Appearances
year
Season

Value

Returns a value equal to (((wOBA-linearWeights$wOBA[which(linearWeights$Season == year)])/linearWeights$wOBAScale[which(linearWeights$Season == year)])+weights$RPerPA[which(linearWeights$Season == year)])*PA

Details

wRC is reported with runs as the units

References

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

See Also

woba,wraa,wrcplus

Examples

Run this code
## Let's calculate Mike Trout's 2014 wRC
## He had a wOBA of .402 and 705 PA's
## We should return 125.879
wrc(.402,705,2014)

## The function is currently defined as
function (wOBA, PA, year) 
{
    wrc <- (((wOBA - linearWeights$wOBA[which(linearWeights$Season == 
        year)])/linearWeights$wOBAScale[which(linearWeights$Season == 
        year)]) + weights$RPerPA[which(linearWeights$Season == 
        year)]) * PA
    return(wrc)
  }

Run the code above in your browser using DataLab