Skip to contents

This function allows you to calculate FIP and related metrics for any given set of data, provided the right variables are in the data set. The function currently returns both FIP per inning pitched, wOBA against (based on batters faced), and wOBA against per instance of fair contact.

Usage

fip_plus(df)

Arguments

df

A data frame of statistics that includes, at a minimum, the following columns: IP (innings pitched), BF (batters faced), uBB (unintentional walks), HBP (Hit By Pitch), x1B (singles), x2B (doubles), x3B (triples), HR (home runs), AB (at-bats), SH (sacrifice hits), SO (strike outs), and season.

Value

Returns a tibble with the following columns:

col_nametypesdescription
bbref_idcharacterBaseball-Reference player id
seasonintegerSeason (4-digit year)
NamecharacterPlayer name
AgenumericPlayer age
LevelcharacterLevel of play (e.g. MLB or minor-league level)
TeamcharacterTeam name
GnumericGames
GSnumericGames started
WnumericWins
LnumericLosses
SVnumericSaves
IPnumericInnings pitched
HnumericHits allowed
RnumericRuns allowed
ERnumericEarned runs allowed
uBBnumericUnintentional walks allowed
BBnumericWalks (bases on balls) allowed
SOnumericStrikeouts
HRnumericHome runs allowed
HBPnumericHit batters
ERAnumericEarned run average
ABnumericAt-bats against
X1BnumericSingles allowed
X2BnumericDoubles allowed
X3BnumericTriples allowed
IBBnumericIntentional walks allowed
GDPnumericGrounded into double plays induced
SFnumericSacrifice flies allowed
SBnumericStolen bases allowed
CSnumericCaught stealing
POnumericPickoffs
BFnumericBatters faced
PitnumericPitches thrown
StrnumericStrikes thrown
StLnumericStrikes looking (called)
StSnumericStrikes swinging (whiffs)
GB.FBnumericGround ball to fly ball ratio
LDnumericLine drives allowed
PUnumericPop ups (infield fly) induced
WHIPnumericWalks plus hits per inning pitched
BAbipnumericBatting average on balls in play allowed
SO9numericStrikeouts per nine innings
SO.WnumericStrikeout-to-walk ratio
SO_percnumericStrikeout percentage
uBB_percnumericUnintentional walk percentage
SO_uBBnumericStrikeout percentage minus unintentional walk percentage
FIPnumericFielding independent pitching
wOBA_againstnumericWeighted on-base average against (based on batters faced)
wOBA_CON_againstnumericWeighted on-base average against per instance of fair contact

Examples

# \donttest{
  try({
    df <- bref_daily_pitcher("2015-04-05", "2015-04-30")
    fip_plus(df)
  })
#> ── MLB Daily Pitcher data from baseball-reference.com ──────────────────
#>  Data updated: 2026-06-24 02:05:32 UTC
#> # A tibble: 453 × 49
#>    bbref_id season Name    Age Level Team      G    GS     W     L    SV
#>    <chr>     <int> <chr> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#>  1 hembrhe…   2015 Heat…    26 Maj-… Bost…     1     0    NA    NA    NA
#>  2 hollade…   2015 Dere…    28 Maj-… Texas     1     1    NA     1    NA
#>  3 edwarjo…   2015 Jon …    27 Maj-… Texas     1     0    NA    NA    NA
#>  4 mazzoco…   2015 Cory…    25 Maj-… San …     2     0    NA    NA    NA
#>  5 gonzase…   2015 Seve…    22 Maj-… Phil…     1     1    NA     1    NA
#>  6 cornejo…   2015 John…    26 Maj-… Atla…     1     0    NA    NA    NA
#>  7 rearich…   2015 Chri…    27 Maj-… San …     5     0    NA    NA    NA
#>  8 vealdo01   2015 Donn…    30 Maj-… Atla…     1     0    NA    NA    NA
#>  9 rondojo…   2015 Jorg…    27 Maj-… Colo…     1     0    NA    NA    NA
#> 10 ranauan…   2015 Anth…    25 Maj-… Texas     1     1    NA     1    NA
#> # ℹ 443 more rows
#> # ℹ 38 more variables: IP <dbl>, H <dbl>, R <dbl>, ER <dbl>, uBB <dbl>,
#> #   BB <dbl>, SO <dbl>, HR <dbl>, HBP <dbl>, ERA <dbl>, AB <dbl>,
#> #   X1B <dbl>, X2B <dbl>, X3B <dbl>, IBB <dbl>, GDP <dbl>, SF <dbl>,
#> #   SB <dbl>, CS <dbl>, PO <dbl>, BF <dbl>, Pit <dbl>, Str <dbl>,
#> #   StL <dbl>, StS <dbl>, GB.FB <dbl>, LD <dbl>, PU <dbl>, WHIP <dbl>,
#> #   BAbip <dbl>, SO9 <dbl>, SO.W <dbl>, SO_perc <dbl>, …
# }