Learn R Programming

Sabermetrics (version 1.0)

rcBasic: Runs Created (Basic)

Description

Basic description of how many runs a hitter contributes to his team

Usage

rcBasic(H, BB, TB, AB)

Arguments

H
Hits
BB
Walks
TB
Total Bases
AB
At Bats

Value

  • Returns ((H+BB)*TB)/(AB+BB)

References

http://en.wikipedia.org/wiki/Runs_created

See Also

Runs Created (with stolen bases) rcBasicSB and Runs Created (Technical) rcTech

Examples

Run this code
## This is a generic runs created formula
## Let's see how many runs created (keep in mind this is an estimate) ## a batter will make with 
## 100 hits, 7 walks (BB), 80 total bases, and 300 at bats

function (H, BB, TB, AB) 
{
    rc <- ((H + BB) * TB)/(AB + BB)
    return(rc)
  }
  
  rcBasic(100,7,80,300) # Should output 27.88274 runs

Run the code above in your browser using DataLab