Learn R Programming

baseballr (version 2.0.0)

bref_daily_pitcher: Scrape Pitcher Performance Data Over a Custom Time Frame

Description

This function allows you to scrape basic pitcher statistics over a custom time frame. Data is sourced from Baseball-Reference.com.

Usage

bref_daily_pitcher(t1, t2)

Value

Returns a tibble of pitcher performance over the requested date range, one row per player, with the following columns:

col_nametypesdescription
bbref_idcharacterBaseball-Reference player id (slug).
seasonintegerSeason year.
NamecharacterPlayer name.
AgenumericPlayer age during the season.
LevelcharacterLeague level (e.g. Maj-AL, Maj-NL).
TeamcharacterTeam name.
GnumericGames pitched.
GSnumericGames started.
WnumericWins.
LnumericLosses.
SVnumericSaves.
IPnumericInnings pitched.
HnumericHits allowed.
RnumericRuns allowed.
ERnumericEarned runs allowed.
uBBnumericUnintentional walks allowed.
BBnumericWalks allowed.
SOnumericStrikeouts.
HRnumericHome runs allowed.
HBPnumericBatters hit by pitch.
ERAnumericEarned run average (per 9 innings).
ABnumericAt-bats against.
X1BnumericSingles allowed.
X2BnumericDoubles allowed.
X3BnumericTriples allowed.
IBBnumericIntentional walks allowed.
GDPnumericDouble plays induced.
SFnumericSacrifice flies allowed.
SBnumericStolen bases allowed.
CSnumericRunners caught stealing.
POnumericPickoffs.
BFnumericBatters faced.
PitnumericTotal pitches thrown.
StrnumericStrikes thrown (as a share of pitches).
StLnumericLooking (called) strikes share.
StSnumericSwinging strikes share.
GB.FBnumericGround ball to fly ball share.
LDnumericLine drive share.
PUnumericPop-up (infield fly) share.
WHIPnumericWalks plus hits per inning pitched.
BAbipnumericBatting average on balls in play allowed.
SO9numericStrikeouts per 9 innings.
SO.WnumericStrikeout-to-walk ratio.
SO_percnumericStrikeout rate (per batter faced).
uBB_percnumericUnintentional walk rate (per batter faced).
SO_uBBnumericStrikeouts minus unintentional walks.

Arguments

t1

First date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

t2

Last date data should be scraped from. Should take the form "YEAR-MONTH-DAY"

Examples

Run this code
# \donttest{
  try(bref_daily_pitcher("2015-05-10", "2015-06-20"))
# }

Run the code above in your browser using DataLab