fip_plus: *Calculate FIP and related metrics for any set of data*

View source: R/metrics_fip_plus.R

fip_plusR Documentation

Calculate FIP and related metrics for any set of data

Description

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_name types description
bbref_id character Baseball-Reference player id
season integer Season (4-digit year)
Name character Player name
Age numeric Player age
Level character Level of play (e.g. MLB or minor-league level)
Team character Team name
G numeric Games
GS numeric Games started
W numeric Wins
L numeric Losses
SV numeric Saves
IP numeric Innings pitched
H numeric Hits allowed
R numeric Runs allowed
ER numeric Earned runs allowed
uBB numeric Unintentional walks allowed
BB numeric Walks (bases on balls) allowed
SO numeric Strikeouts
HR numeric Home runs allowed
HBP numeric Hit batters
ERA numeric Earned run average
AB numeric At-bats against
X1B numeric Singles allowed
X2B numeric Doubles allowed
X3B numeric Triples allowed
IBB numeric Intentional walks allowed
GDP numeric Grounded into double plays induced
SF numeric Sacrifice flies allowed
SB numeric Stolen bases allowed
CS numeric Caught stealing
PO numeric Pickoffs
BF numeric Batters faced
Pit numeric Pitches thrown
Str numeric Strikes thrown
StL numeric Strikes looking (called)
StS numeric Strikes swinging (whiffs)
GB.FB numeric Ground ball to fly ball ratio
LD numeric Line drives allowed
PU numeric Pop ups (infield fly) induced
WHIP numeric Walks plus hits per inning pitched
BAbip numeric Batting average on balls in play allowed
SO9 numeric Strikeouts per nine innings
SO.W numeric Strikeout-to-walk ratio
SO_perc numeric Strikeout percentage
uBB_perc numeric Unintentional walk percentage
SO_uBB numeric Strikeout percentage minus unintentional walk percentage
FIP numeric Fielding independent pitching
wOBA_against numeric Weighted on-base average against (based on batters faced)
wOBA_CON_against numeric Weighted on-base average against per instance of fair contact

Examples


  try({
    df <- bref_daily_pitcher("2015-04-05", "2015-04-30")
    fip_plus(df)
  })


baseballr documentation built on Aug. 27, 2026, 1:07 a.m.