Learn R Programming

Sabermetrics (version 2.0)

lgwSB: League wSB

Description

This function helps find the League wSB

Usage

lgwSB(year, SB, CS, single, bb, hbp, ibb)

Arguments

year
Season
SB
League Stolen Bases
CS
League Caught Stealing
single
Singles
bb
Walks
hbp
Hit By Pitches
ibb
Intentional Walks

Value

Returns a value equal to (SB * runSB + CS * runCS) / (single + bb + hbp - ibb)

References

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

See Also

wsb

Examples

Run this code
## The function is currently defined as
function (year, SB, CS, single, bb, hbp, ibb) 
{
    runSB <- linearWeights$runSB[which(linearWeights$Season == 
        year)]
    runCS <- linearWeights$runCS[which(linearWeights$Season == 
        year)]
    lgwSB <- (SB * runSB + CS * runCS)/(single + bb + hbp - ibb)
  }

Run the code above in your browser using DataLab