Skip to contents

This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.

Usage

fg_batter_leaders(
  age = "",
  pos = "all",
  stats = "bat",
  lg = "all",
  qual = "0",
  startseason = "2023",
  endseason = "2023",
  startdate = "",
  enddate = "",
  month = "0",
  hand = "",
  team = "0",
  pageitems = "10000",
  pagenum = "1",
  ind = "0",
  rost = "0",
  players = "",
  type = "8",
  postseason = "",
  sortdir = "default",
  sortstat = "WAR"
)

Arguments

age

(integer) Age of players

pos

(character) Position of players, defaults to "all". To exclude pitchers, use "np".

stats

(character) Statistic to return. Defaults to "bat".

lg

(character) League to return. Defaults to "all". Options are "al", "nl", or "all".

qual

(character) Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".

startseason

(character) Season for which you want to scrape the data.

endseason

(character) Last season for which you want data.

startdate

(character) Start date for which you want data.

enddate

(character) End date for which you want data.

month

(character) Month for which you want data.

hand

(character) Handedness of batter. Options are "L", "R", or "B". Empty string returns all.

team

(character) Teams for which you want data, comma separated.

pageitems

(character) Number of items per page.

pagenum

(character) Page number.

ind

(character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.

rost

(character) Whether or not to include players on the roster. 1 = include, 0 = exclude.

players

(character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.

type

(character) Defaults to 8, which is the standard leaderboard. The values for the leaderboards appear to go to from type = 0 to 48+, which correspond to links on the leaderboard page.

postseason

(logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.

sortdir

(character) Sort direction. Options are "asc" or "desc" or "default".

sortstat

(character) Sort by stat. Default is "WAR".

Value

A data frame of batter data.

col_nametypesdescription
SeasonintegerSeason (YYYY).
team_namecharacterTeam name.
BatscharacterBatting handedness (L/R/S).
xMLBAMIDintegerMLBAM player ID.
PlayerNameRoutecharacterPlayer name URL slug used by FanGraphs.
PlayerNamecharacterPlayer name.
playeridintegerFanGraphs player ID.
AgeintegerPlayer age.
AgeRngcharacterPlayer age range across the span.
SeasonMinintegerFirst season in the queried span.
SeasonMaxintegerLast season in the queried span.
GintegerGames played.
ABintegerAt-bats.
PAintegerPlate appearances.
HintegerHits.
1BintegerSingles.
2BintegerDoubles.
3BintegerTriples.
HRintegerHome runs.
RintegerRuns scored.
RBIintegerRuns batted in.
BBintegerWalks (bases on balls).
IBBintegerIntentional walks.
SOintegerStrikeouts.
HBPintegerHit by pitch.
SFintegerSacrifice flies.
SHintegerSacrifice hits (bunts).
GDPintegerGrounded into double plays.
SBintegerStolen bases.
CSintegerCaught stealing.
AVGnumericBatting average (or opponent average for pitchers).
GBintegerGround balls.
FBintegerFly balls.
LDintegerLine drives.
IFFBintegerInfield fly balls.
PitchesintegerTotal pitches seen or thrown.
BallsintegerTotal balls.
StrikesintegerTotal strikes.
IFHintegerInfield hits.
BUintegerBunts.
BUHintegerBunt hits.
BB_pctnumericWalk rate.
K_pctnumericStrikeout rate.
BB_KnumericWalk-to-strikeout ratio.
OBPnumericOn-base percentage.
SLGnumericSlugging percentage.
OPSnumericOn-base plus slugging.
ISOnumericIsolated power.
BABIPnumericBatting average on balls in play.
GB_FBnumericGround-ball to fly-ball ratio.
LD_pctnumericLine-drive percentage.
GB_pctnumericGround-ball percentage.
FB_pctnumericFly-ball percentage.
IFFB_pctnumericInfield-fly-ball percentage.
HR_FBnumericHome-run-per-fly-ball rate.
IFH_pctnumericInfield-hit percentage.
BUH_pctnumericBunt-hit percentage.
TTO_pctnumericThree-true-outcomes percentage (BB, K, HR).
wOBAnumericWeighted On-Base Average.
wRAAnumericWeighted Runs Above Average.
wRCnumericWeighted Runs Created.
BattingnumericBatting runs above average.
FieldingnumericFielding runs above average.
ReplacementnumericReplacement-level runs.
PositionalnumericPositional adjustment runs.
wLeaguenumericLeague adjustment runs.
DefensenumericTotal defensive value (runs above average).
OffensenumericTotal offensive value (runs above average).
RARnumericRuns Above Replacement.
WARnumericWins Above Replacement.
WAROldnumericWins Above Replacement (legacy formulation).
DollarsnumericEstimated market value of production.
BaseRunningnumericBase-running runs above average.
SpdnumericSpeed Score.
wRC_plusnumericWeighted Runs Created Plus (park/league-adjusted, 100 = average).
wBsRnumericWeighted Base Running runs.
WPAnumericWin Probability Added.
WPA_minusnumericNegative Win Probability Added.
WPA_plusnumericPositive Win Probability Added.
RE24numericRun Expectancy based on the 24 base-out states.
REWnumericRun Expectancy Wins.
pLInumericAverage Leverage Index.
PHintegerPinch-hit appearances.
WPA_LInumericSituational Win Probability Added (WPA divided by Leverage Index).
ClutchnumericClutch performance relative to context-neutral performance.
FB_pct1numericOverall fastball percentage (pitch usage).
FBvnumericAverage fastball velocity.
SL_pctnumericSlider percentage (pitch usage).
SLvnumericAverage slider velocity.
CT_pctnumericCutter percentage (pitch usage).
CTvnumericAverage cutter velocity.
CB_pctnumericCurveball percentage (pitch usage).
CBvnumericAverage curveball velocity.
CH_pctnumericChangeup percentage (pitch usage).
CHvnumericAverage changeup velocity.
SF_pctnumericSplitter percentage (pitch usage).
SFvnumericAverage splitter velocity.
XX_pctnumericUnidentified-pitch percentage (pitch usage).
wFBnumericFastball pitch-type linear weight runs.
wSLnumericSlider pitch-type linear weight runs.
wCTnumericCutter pitch-type linear weight runs.
wCBnumericCurveball pitch-type linear weight runs.
wCHnumericChangeup pitch-type linear weight runs.
wSFnumericSplitter pitch-type linear weight runs.
wFB_CnumericFastball linear weight runs per 100 pitches.
wSL_CnumericSlider linear weight runs per 100 pitches.
wCT_CnumericCutter linear weight runs per 100 pitches.
wCB_CnumericCurveball linear weight runs per 100 pitches.
wCH_CnumericChangeup linear weight runs per 100 pitches.
wSF_CnumericSplitter linear weight runs per 100 pitches.
O-Swing_pctnumericSwing percentage on pitches outside the zone (chase rate).
Z-Swing_pctnumericSwing percentage on pitches inside the zone.
Swing_pctnumericOverall swing percentage.
O-Contact_pctnumericContact percentage on pitches outside the zone.
Z-Contact_pctnumericContact percentage on pitches inside the zone.
Contact_pctnumericOverall contact percentage.
Zone_pctnumericPercentage of pitches in the strike zone.
F-Strike_pctnumericFirst-pitch strike percentage.
SwStr_pctnumericSwinging-strike percentage.
CStr_pctnumericCalled-strike percentage.
C+SwStr_pctnumericCombined called- plus swinging-strike percentage.
PullintegerBalls in play hit to the pull field.
CentintegerBalls in play hit up the middle.
OppointegerBalls in play hit to the opposite field.
SoftintegerSoft-contact balls in play.
MedintegerMedium-contact balls in play.
HardintegerHard-contact balls in play.
bipCountintegerCount of balls in play with contact-quality data.
Pull_pctnumericPull-field percentage.
Cent_pctnumericUp-the-middle percentage.
Oppo_pctnumericOpposite-field percentage.
Soft_pctnumericSoft-contact percentage.
Med_pctnumericMedium-contact percentage.
Hard_pctnumericHard-contact percentage.
UBRnumericUltimate Base Running runs.
GDPRunsnumericRuns from grounded-into-double-play avoidance.
AVG+numericPark/league-adjusted batting average (100 = average).
BB_pct+numericPark/league-adjusted walk rate (100 = average).
K_pct+numericPark/league-adjusted strikeout rate (100 = average).
OBP+numericPark/league-adjusted on-base percentage (100 = average).
SLG+numericPark/league-adjusted slugging percentage (100 = average).
ISO+numericPark/league-adjusted isolated power (100 = average).
BABIP+numericPark/league-adjusted BABIP (100 = average).
LD_pct+numericPark/league-adjusted line-drive rate (100 = average).
GB_pct+numericPark/league-adjusted ground-ball rate (100 = average).
FB_pct+numericPark/league-adjusted fly-ball rate (100 = average).
HRFB_pct+numericPark/league-adjusted home-run-per-fly-ball rate (100 = average).
Pull_pct+numericPark/league-adjusted pull rate (100 = average).
Cent_pct+numericPark/league-adjusted up-the-middle rate (100 = average).
Oppo_pct+numericPark/league-adjusted opposite-field rate (100 = average).
Soft_pct+numericPark/league-adjusted soft-contact rate (100 = average).
Med_pct+numericPark/league-adjusted medium-contact rate (100 = average).
Hard_pct+numericPark/league-adjusted hard-contact rate (100 = average).
xwOBAnumericExpected Weighted On-Base Average (Statcast).
xAVGnumericExpected batting average (Statcast).
xSLGnumericExpected slugging percentage (Statcast).
XBRnumericExtra bases taken on the bases, runs above average.
PPTVintegerPitch-type pitch values (raw component).
CPTVintegerCatcher pitch-type value (raw component).
BPTVintegerBatter pitch-type value (raw component).
DSVintegerDefensive stuff value (raw component).
DGVintegerDefensive game value (raw component).
BTVintegerBase-state team value (raw component).
rPPTVnumericRegressed pitch-type pitch values.
rBPTVnumericRegressed batter pitch-type value.
EBVintegerEarned-base value (raw component).
ESVintegerEarned-strike value (raw component).
rFTeamVnumericRegressed fielding team value.
rBTeamVnumericRegressed base-running team value.
rTVnumericRegressed total team value.
pfx_FA_pctnumericPITCHf/x four-seam fastballs usage percentage.
pfx_FC_pctnumericPITCHf/x cutters usage percentage.
pfx_FS_pctnumericPITCHf/x splitters usage percentage.
pfx_FO_pctnumericPITCHf/x forkballs/pitch-outs usage percentage.
pfx_SI_pctnumericPITCHf/x sinkers usage percentage.
pfx_SL_pctnumericPITCHf/x sliders usage percentage.
pfx_CU_pctnumericPITCHf/x curveballs usage percentage.
pfx_KC_pctnumericPITCHf/x knuckle-curves usage percentage.
pfx_EP_pctnumericPITCHf/x eephus pitches usage percentage.
pfx_CH_pctnumericPITCHf/x changeups usage percentage.
pfx_SC_pctnumericPITCHf/x screwballs usage percentage.
pfx_SLO_pctnumericPITCHf/x slurves usage percentage.
pfx_ST_pctnumericPITCHf/x sweepers usage percentage.
pfx_CUO_pctnumericPITCHf/x slurves usage percentage.
pfx_CV_pctnumericPITCHf/x slow curves usage percentage.
pfx_vFAnumericPITCHf/x average four-seam fastballs velocity.
pfx_vFCnumericPITCHf/x average cutters velocity.
pfx_vFSnumericPITCHf/x average splitters velocity.
pfx_vFOnumericPITCHf/x average forkballs/pitch-outs velocity.
pfx_vSInumericPITCHf/x average sinkers velocity.
pfx_vSLnumericPITCHf/x average sliders velocity.
pfx_vCUnumericPITCHf/x average curveballs velocity.
pfx_vKCnumericPITCHf/x average knuckle-curves velocity.
pfx_vEPnumericPITCHf/x average eephus pitches velocity.
pfx_vCHnumericPITCHf/x average changeups velocity.
pfx_vSCnumericPITCHf/x average screwballs velocity.
pfx_vSLOnumericPITCHf/x average slurves velocity.
pfx_vSTnumericPITCHf/x average sweepers velocity.
pfx_vCUOnumericPITCHf/x average slurves velocity.
pfx_vCVnumericPITCHf/x average slow curves velocity.
pfx_FA-XnumericPITCHf/x average horizontal movement on four-seam fastballs.
pfx_FC-XnumericPITCHf/x average horizontal movement on cutters.
pfx_FS-XnumericPITCHf/x average horizontal movement on splitters.
pfx_FO-XnumericPITCHf/x average horizontal movement on forkballs/pitch-outs.
pfx_SI-XnumericPITCHf/x average horizontal movement on sinkers.
pfx_SL-XnumericPITCHf/x average horizontal movement on sliders.
pfx_CU-XnumericPITCHf/x average horizontal movement on curveballs.
pfx_KC-XnumericPITCHf/x average horizontal movement on knuckle-curves.
pfx_EP-XnumericPITCHf/x average horizontal movement on eephus pitches.
pfx_CH-XnumericPITCHf/x average horizontal movement on changeups.
pfx_SC-XnumericPITCHf/x average horizontal movement on screwballs.
pfx_SLO-XnumericPITCHf/x average horizontal movement on slurves.
pfx_ST-XnumericPITCHf/x average horizontal movement on sweepers.
pfx_CUO-XnumericPITCHf/x average horizontal movement on slurves.
pfx_CV-XnumericPITCHf/x average horizontal movement on slow curves.
pfx_FA-ZnumericPITCHf/x average vertical movement on four-seam fastballs.
pfx_FC-ZnumericPITCHf/x average vertical movement on cutters.
pfx_FS-ZnumericPITCHf/x average vertical movement on splitters.
pfx_FO-ZnumericPITCHf/x average vertical movement on forkballs/pitch-outs.
pfx_SI-ZnumericPITCHf/x average vertical movement on sinkers.
pfx_SL-ZnumericPITCHf/x average vertical movement on sliders.
pfx_CU-ZnumericPITCHf/x average vertical movement on curveballs.
pfx_KC-ZnumericPITCHf/x average vertical movement on knuckle-curves.
pfx_EP-ZnumericPITCHf/x average vertical movement on eephus pitches.
pfx_CH-ZnumericPITCHf/x average vertical movement on changeups.
pfx_SC-ZnumericPITCHf/x average vertical movement on screwballs.
pfx_SLO-ZnumericPITCHf/x average vertical movement on slurves.
pfx_ST-ZnumericPITCHf/x average vertical movement on sweepers.
pfx_CUO-ZnumericPITCHf/x average vertical movement on slurves.
pfx_CV-ZnumericPITCHf/x average vertical movement on slow curves.
pfx_wFAnumericPITCHf/x four-seam fastballs linear weight runs.
pfx_wFCnumericPITCHf/x cutters linear weight runs.
pfx_wFSnumericPITCHf/x splitters linear weight runs.
pfx_wFOnumericPITCHf/x forkballs/pitch-outs linear weight runs.
pfx_wSInumericPITCHf/x sinkers linear weight runs.
pfx_wSLnumericPITCHf/x sliders linear weight runs.
pfx_wCUnumericPITCHf/x curveballs linear weight runs.
pfx_wKCnumericPITCHf/x knuckle-curves linear weight runs.
pfx_wEPnumericPITCHf/x eephus pitches linear weight runs.
pfx_wCHnumericPITCHf/x changeups linear weight runs.
pfx_wSCnumericPITCHf/x screwballs linear weight runs.
pfx_wSLOnumericPITCHf/x slurves linear weight runs.
pfx_wSTnumericPITCHf/x sweepers linear weight runs.
pfx_wCUOnumericPITCHf/x slurves linear weight runs.
pfx_wCVnumericPITCHf/x slow curves linear weight runs.
pfx_wFA_CnumericPITCHf/x four-seam fastballs linear weight runs per 100 pitches.
pfx_wFC_CnumericPITCHf/x cutters linear weight runs per 100 pitches.
pfx_wFS_CnumericPITCHf/x splitters linear weight runs per 100 pitches.
pfx_wFO_CnumericPITCHf/x forkballs/pitch-outs linear weight runs per 100 pitches.
pfx_wSI_CnumericPITCHf/x sinkers linear weight runs per 100 pitches.
pfx_wSL_CnumericPITCHf/x sliders linear weight runs per 100 pitches.
pfx_wCU_CnumericPITCHf/x curveballs linear weight runs per 100 pitches.
pfx_wKC_CnumericPITCHf/x knuckle-curves linear weight runs per 100 pitches.
pfx_wEP_CnumericPITCHf/x eephus pitches linear weight runs per 100 pitches.
pfx_wCH_CnumericPITCHf/x changeups linear weight runs per 100 pitches.
pfx_wSC_CnumericPITCHf/x screwballs linear weight runs per 100 pitches.
pfx_wSLO_CnumericPITCHf/x slurves linear weight runs per 100 pitches.
pfx_wST_CnumericPITCHf/x sweepers linear weight runs per 100 pitches.
pfx_wCUO_CnumericPITCHf/x slurves linear weight runs per 100 pitches.
pfx_wCV_CnumericPITCHf/x slow curves linear weight runs per 100 pitches.
pfx_aaFAnumericPITCHf/x average arsenal value on four-seam fastballs.
pfx_aaFCnumericPITCHf/x average arsenal value on cutters.
pfx_aaFSnumericPITCHf/x average arsenal value on splitters.
pfx_aaFOnumericPITCHf/x average arsenal value on forkballs/pitch-outs.
pfx_aaSInumericPITCHf/x average arsenal value on sinkers.
pfx_aaSLnumericPITCHf/x average arsenal value on sliders.
pfx_aaCUnumericPITCHf/x average arsenal value on curveballs.
pfx_aaKCnumericPITCHf/x average arsenal value on knuckle-curves.
pfx_aaEPnumericPITCHf/x average arsenal value on eephus pitches.
pfx_aaCHnumericPITCHf/x average arsenal value on changeups.
pfx_aaSCnumericPITCHf/x average arsenal value on screwballs.
pfx_aaSLOnumericPITCHf/x average arsenal value on slurves.
pfx_aaSTnumericPITCHf/x average arsenal value on sweepers.
pfx_aaCUOnumericPITCHf/x average arsenal value on slurves.
pfx_aaCVnumericPITCHf/x average arsenal value on slow curves.
pfx_spFAnumericPITCHf/x Stuff+ value on four-seam fastballs.
pfx_spFCnumericPITCHf/x Stuff+ value on cutters.
pfx_spFSnumericPITCHf/x Stuff+ value on splitters.
pfx_spFOnumericPITCHf/x Stuff+ value on forkballs/pitch-outs.
pfx_spSInumericPITCHf/x Stuff+ value on sinkers.
pfx_spSLnumericPITCHf/x Stuff+ value on sliders.
pfx_spCUnumericPITCHf/x Stuff+ value on curveballs.
pfx_spKCnumericPITCHf/x Stuff+ value on knuckle-curves.
pfx_spEPnumericPITCHf/x Stuff+ value on eephus pitches.
pfx_spCHnumericPITCHf/x Stuff+ value on changeups.
pfx_spSCnumericPITCHf/x Stuff+ value on screwballs.
pfx_spSLOnumericPITCHf/x Stuff+ value on slurves.
pfx_spSTnumericPITCHf/x Stuff+ value on sweepers.
pfx_spCUOnumericPITCHf/x Stuff+ value on slurves.
pfx_spCVnumericPITCHf/x Stuff+ value on slow curves.
pfx_O-Swing_pctnumericPITCHf/x swing percentage on pitches outside the zone.
pfx_Z-Swing_pctnumericPITCHf/x swing percentage on pitches inside the zone.
pfx_Swing_pctnumericPITCHf/x swing percentage.
pfx_O-Contact_pctnumericPITCHf/x contact percentage on pitches outside the zone.
pfx_Z-Contact_pctnumericPITCHf/x contact percentage on pitches inside the zone.
pfx_Contact_pctnumericPITCHf/x contact percentage.
pfx_Zone_pctnumericPITCHf/x percentage of pitches in the strike zone.
pfx_PacenumericPITCHf/x pace (seconds between pitches).
AvgBatSpeednumericAverage bat speed (mph).
FastSwing_pctnumericFast-swing percentage (75+ mph bat speed).
SwingLengthnumericAverage swing length (feet).
SquaredUpContact_pctnumericSquared-up percentage per batted-ball contact.
SquaredUpSwing_pctnumericSquared-up percentage per swing.
BlastContact_pctnumericBlast percentage per batted-ball contact.
BlastSwing_pctnumericBlast percentage per swing.
SwordsintegerSwords (awkward, defensive swinging strikes induced).
CompetitiveSwingsintegerCompetitive swings tracked.
TiltnumericAverage swing tilt (degrees).
AttackAnglenumericAverage attack angle (degrees).
AttackDirectionnumericAverage attack direction (degrees).
IdealAttackAngle_pctnumericPercentage of swings in the ideal attack-angle range.
DepthInBoxnumericAverage batter depth in the box (inches).
DistanceOffPlatenumericAverage batter distance off the plate (inches).
scH-Swing_pctnumericStatcast swing percentage on hard-hit pitches.
scH-Contact_pctnumericStatcast contact percentage on hard-hit pitches.
scH-Zone_pctnumericStatcast in-zone percentage on hard-hit pitches.
scS-Swing_pctnumericStatcast swing percentage on slider pitches.
scS-Contact_pctnumericStatcast contact percentage on slider pitches.
scS-Zone_pctnumericStatcast in-zone percentage on slider pitches.
scC-Swing_pctnumericStatcast swing percentage on curveball pitches.
scC-Contact_pctnumericStatcast contact percentage on curveball pitches.
scC-Zone_pctnumericStatcast in-zone percentage on curveball pitches.
scW-Swing_pctnumericStatcast swing percentage on offspeed pitches.
scW-Contact_pctnumericStatcast contact percentage on offspeed pitches.
scW-Zone_pctnumericStatcast in-zone percentage on offspeed pitches.
scSI-Swing_pctnumericStatcast swing percentage on sinker pitches.
scSI-Contact_pctnumericStatcast contact percentage on sinker pitches.
scSI-Zone_pctnumericStatcast in-zone percentage on sinker pitches.
scSO-Swing_pctnumericStatcast swing percentage on softly-hit pitches.
scSO-Contact_pctnumericStatcast contact percentage on softly-hit pitches.
scSO-Zone_pctnumericStatcast in-zone percentage on softly-hit pitches.
scO-Swing_pctnumericStatcast swing percentage on out-of-zone pitches.
scO-Contact_pctnumericStatcast contact percentage on out-of-zone pitches.
scO-Zone_pctnumericStatcast in-zone percentage on out-of-zone pitches.
scZ-Swing_pctnumericStatcast swing percentage on in-zone pitches.
scZ-Contact_pctnumericStatcast contact percentage on in-zone pitches.
scZ-Zone_pctnumericStatcast in-zone percentage on in-zone pitches.
pi_CH_pctnumericPITCHInfo changeups usage percentage.
pi_CU_pctnumericPITCHInfo curveballs usage percentage.
pi_FA_pctnumericPITCHInfo four-seam fastballs usage percentage.
pi_FC_pctnumericPITCHInfo cutters usage percentage.
pi_FS_pctnumericPITCHInfo splitters usage percentage.
pi_SB_pctnumericPITCHInfo slow-balls usage percentage.
pi_SI_pctnumericPITCHInfo sinkers usage percentage.
pi_SL_pctnumericPITCHInfo sliders usage percentage.
pi_vCHnumericPITCHInfo average changeups velocity.
pi_vCUnumericPITCHInfo average curveballs velocity.
pi_vFAnumericPITCHInfo average four-seam fastballs velocity.
pi_vFCnumericPITCHInfo average cutters velocity.
pi_vFSnumericPITCHInfo average splitters velocity.
pi_vSBnumericPITCHInfo average slow-balls velocity.
pi_vSInumericPITCHInfo average sinkers velocity.
pi_vSLnumericPITCHInfo average sliders velocity.
pi_CH-XnumericPITCHInfo average horizontal movement on changeups.
pi_CU-XnumericPITCHInfo average horizontal movement on curveballs.
pi_FA-XnumericPITCHInfo average horizontal movement on four-seam fastballs.
pi_FC-XnumericPITCHInfo average horizontal movement on cutters.
pi_FS-XnumericPITCHInfo average horizontal movement on splitters.
pi_SB-XnumericPITCHInfo average horizontal movement on slow-balls.
pi_SI-XnumericPITCHInfo average horizontal movement on sinkers.
pi_SL-XnumericPITCHInfo average horizontal movement on sliders.
pi_CH-ZnumericPITCHInfo average vertical movement on changeups.
pi_CU-ZnumericPITCHInfo average vertical movement on curveballs.
pi_FA-ZnumericPITCHInfo average vertical movement on four-seam fastballs.
pi_FC-ZnumericPITCHInfo average vertical movement on cutters.
pi_FS-ZnumericPITCHInfo average vertical movement on splitters.
pi_SB-ZnumericPITCHInfo average vertical movement on slow-balls.
pi_SI-ZnumericPITCHInfo average vertical movement on sinkers.
pi_SL-ZnumericPITCHInfo average vertical movement on sliders.
pi_wCHnumericPITCHInfo changeups linear weight runs.
pi_wCUnumericPITCHInfo curveballs linear weight runs.
pi_wFAnumericPITCHInfo four-seam fastballs linear weight runs.
pi_wFCnumericPITCHInfo cutters linear weight runs.
pi_wFSnumericPITCHInfo splitters linear weight runs.
pi_wSBnumericPITCHInfo slow-balls linear weight runs.
pi_wSInumericPITCHInfo sinkers linear weight runs.
pi_wSLnumericPITCHInfo sliders linear weight runs.
pi_wCH_CnumericPITCHInfo changeups linear weight runs per 100 pitches.
pi_wCU_CnumericPITCHInfo curveballs linear weight runs per 100 pitches.
pi_wFA_CnumericPITCHInfo four-seam fastballs linear weight runs per 100 pitches.
pi_wFC_CnumericPITCHInfo cutters linear weight runs per 100 pitches.
pi_wFS_CnumericPITCHInfo splitters linear weight runs per 100 pitches.
pi_wSB_CnumericPITCHInfo slow-balls linear weight runs per 100 pitches.
pi_wSI_CnumericPITCHInfo sinkers linear weight runs per 100 pitches.
pi_wSL_CnumericPITCHInfo sliders linear weight runs per 100 pitches.
pi_O-Swing_pctnumericPITCHInfo swing percentage on pitches outside the zone.
pi_Z-Swing_pctnumericPITCHInfo swing percentage on pitches inside the zone.
pi_Swing_pctnumericPITCHInfo swing percentage.
pi_O-Contact_pctnumericPITCHInfo contact percentage on pitches outside the zone.
pi_Z-Contact_pctnumericPITCHInfo contact percentage on pitches inside the zone.
pi_Contact_pctnumericPITCHInfo contact percentage.
pi_Zone_pctnumericPITCHInfo percentage of pitches in the strike zone.
pi_PacenumericPITCHInfo pace (seconds between pitches).
EventsintegerBatted-ball events with Statcast measurement.
EVnumericAverage exit velocity (mph).
LAnumericAverage launch angle (degrees).
BarrelsintegerBarreled batted balls.
Barrel_pctnumericBarrel percentage.
maxEVnumericMaximum exit velocity (mph).
HardHitintegerHard-hit batted balls (95+ mph).
HardHit_pctnumericHard-hit percentage (95+ mph).
QnumericQuality of contact / quality score.
TGintegerTotal games in the span.
TPAintegerTotal plate appearances in the span.
positionDBcharacterPosition code from the database.
positioncharacterPosition played.
team_name_abbcharacterTeam name abbreviation.
teamidintegerFanGraphs team ID.
playerTeamIdintegerFanGraphs player-team ID.
PosnumericPrimary position.
EV90numeric90th-percentile exit velocity (mph).
pi_XX_pctnumericPITCHInfo unidentified pitches usage percentage.
pi_vXXnumericPITCHInfo average unidentified pitches velocity.
pi_XX-XnumericPITCHInfo average horizontal movement on unidentified pitches.
pi_XX-ZnumericPITCHInfo average vertical movement on unidentified pitches.
pi_wXXnumericPITCHInfo unidentified pitches linear weight runs.
pi_wXX_CnumericPITCHInfo unidentified pitches linear weight runs per 100 pitches.
phLInumericAverage Leverage Index in pinch-hit appearances.
pi_CS_pctnumericPITCHInfo slow curves usage percentage.
pi_vCSnumericPITCHInfo average slow curves velocity.
pi_CS-XnumericPITCHInfo average horizontal movement on slow curves.
pi_CS-ZnumericPITCHInfo average vertical movement on slow curves.
pi_wCSnumericPITCHInfo slow curves linear weight runs.
pi_wCS_CnumericPITCHInfo slow curves linear weight runs per 100 pitches.
rBTVnumericRegressed base-state team value.
KN_pctnumericKnuckleball percentage (pitch usage).
KNvnumericAverage knuckleball velocity.
wKNnumericKnuckleball pitch-type linear weight runs.
wKN_CnumericKnuckleball linear weight runs per 100 pitches.
pfx_KN_pctnumericPITCHf/x knuckleballs usage percentage.
pfx_vKNnumericPITCHf/x average knuckleballs velocity.
pfx_KN-XnumericPITCHf/x average horizontal movement on knuckleballs.
pfx_KN-ZnumericPITCHf/x average vertical movement on knuckleballs.
pfx_wKNnumericPITCHf/x knuckleballs linear weight runs.
pfx_wKN_CnumericPITCHf/x knuckleballs linear weight runs per 100 pitches.
pfx_aaKNnumericPITCHf/x average arsenal value on knuckleballs.
pfx_spKNnumericPITCHf/x Stuff+ value on knuckleballs.
pi_KN_pctnumericPITCHInfo knuckleballs usage percentage.
pi_vKNnumericPITCHInfo average knuckleballs velocity.
pi_KN-XnumericPITCHInfo average horizontal movement on knuckleballs.
pi_KN-ZnumericPITCHInfo average vertical movement on knuckleballs.
pi_wKNnumericPITCHInfo knuckleballs linear weight runs.
pi_wKN_CnumericPITCHInfo knuckleballs linear weight runs per 100 pitches.
rCPTVnumericRegressed catcher pitch-type value.
CFramingnumericCatcher framing runs.
rDGVnumericRegressed defensive game value.
rDSVnumericRegressed defensive stuff value.

Examples

# \donttest{
  try(fg_batter_leaders(startseason = 2023, endseason = 2023))
#> ── MLB Player Batting Leaders data from FanGraphs.com ──────────────────
#>  Data updated: 2026-06-12 14:08:50 UTC
#> # A tibble: 1,457 × 447
#>    Season team_name Bats  xMLBAMID PlayerNameRoute  PlayerName  playerid
#>     <int> <chr>     <chr>    <int> <chr>            <chr>          <int>
#>  1   2023 ATL       R       660670 Ronald Acuna Jr. Ronald Acu…    18401
#>  2   2023 LAD       L       518692 Freddie Freeman  Freddie Fr…     5361
#>  3   2023 LAD       R       605141 Mookie Betts     Mookie Bet…    13611
#>  4   2023 LAA       L       660271 Shohei Ohtani    Shohei Oht…    19755
#>  5   2023 ATL       L       621566 Matt Olson       Matt Olson     14344
#>  6   2023 TEX       R       543760 Marcus Semien    Marcus Sem…    12533
#>  7   2023 TEX       L       608369 Corey Seager     Corey Seag…    13624
#>  8   2023 SDP       L       665742 Juan Soto        Juan Soto      20123
#>  9   2023 KCR       R       677951 Bobby Witt Jr.   Bobby Witt…    25764
#> 10   2023 SEA       R       677594 Julio Rodriguez  Julio Rodr…    23697
#> # ℹ 1,447 more rows
#> # ℹ 440 more variables: Age <int>, AgeRng <chr>, SeasonMin <int>,
#> #   SeasonMax <int>, G <int>, AB <int>, PA <int>, H <int>, `1B` <int>,
#> #   `2B` <int>, `3B` <int>, HR <int>, R <int>, RBI <int>, BB <int>,
#> #   IBB <int>, SO <int>, HBP <int>, SF <int>, SH <int>, GDP <int>,
#> #   SB <int>, CS <int>, AVG <dbl>, GB <int>, FB <int>, LD <int>,
#> #   IFFB <int>, Pitches <int>, Balls <int>, Strikes <int>, IFH <int>, …
# }