Description Usage Arguments Examples
Get wOBA values for each year in your database. This calculation requires all fields of the Pitching, Fielding and Batting tables from the Lahman package, or a comparable data set. The function uses a version of Tom Tango's wOBA formula by default, but can also return Fangraphs wOBA values.
1 2 | wOBA_values(BattingTable, PitchingTable, FieldingTable, Sep.Leagues = FALSE,
Fangraphs = FALSE)
|
BattingTable |
A full batting table from the |
PitchingTable |
A full pitching table from the |
FieldingTable |
A full batting table from the |
Sep.Leagues |
If TRUE, this will split the calculation and return unique wOBA values for the various leagues. This can be helpful in handling Designated Hitters and National League pitchers. It also isolates the park factors to their respective leagues. |
Fangraphs |
if TRUE the function will return the Fangraphs wOBA values. By default the function uses a method adapted from
Tom Tango. These values are often very close to Fangraphs, but are not the same due to Fangraphs using a different algorithm.
This can not be used in conjunction with the |
1 2 3 4 5 6 7 8 | data("Batting2016")
head(Batting2016)
data("Pitching2016")
head(Pitching2016)
data("Fielding2016")
head(Fielding2016)
woba_df <- wOBA_values(Batting2016, Pitching2016, Fielding2016, Sep.Leagues=FALSE, Fangraphs=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.