Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Calculate a batter's weighted on-base average (wOBA)
ResourceFunction["BaseballWOBA"][stats] computes a batter's weighted on-base average (wOBA) for the counting statistics stats. | |
ResourceFunction["BaseballWOBA"]["player"] computes wOBA for the specified player. | |
ResourceFunction["BaseballWOBA"][stats,y] computes a batter's weighted on-base average (wOBA) for the counting statistics stats based on the year y. |
Compute Tyler O'Neill's 2021 wOBA using his counting stats:
| In[1]:= | ![]() |
| Out[1]= |
Get Paul Goldschmidt's 2021 wOBA:
| In[2]:= |
| Out[2]= |
Get Nolan Arenado's 2021 wOBA using his Baseball-Reference player id:
| In[3]:= |
| Out[3]= |
Calculate Albert Pujols' wOBA in 2005:
| In[4]:= |
| Out[4]= |
Use custom weights. Statistics without weights are treated like zero:
| In[5]:= | ![]() |
| Out[5]= |
Use FanGraphs weights from a specific year:
| In[6]:= | ![]() |
| Out[6]= |
See what wOBA Mike Trout's 2018 season statistics would have generated in other seasons:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Plot Babe Ruth's yearly wOBA:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License