Learn R Programming

Sabermetrics (version 2.0)

wsb: wSB

Description

wSB is the estimated number of runs a player contributes by stealing bases as compared to the average player.

Usage

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

Arguments

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

Value

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

Details

wSB is useful because it attaches a value to a player's SB count

References

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

See Also

lgwSB

Examples

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

Run the code above in your browser using DataLab