View source: R/bref_daily_batter.R
| bref_daily_batter | R Documentation |
This function allows you to scrape basic batter statistics over a custom time frame. Data is sourced from Baseball-Reference.com.
bref_daily_batter(t1, t2)
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" |
Returns a tibble of batter performance over the requested date range, one row per player, with the following columns:
| col_name | types | description |
| bbref_id | character | Baseball-Reference player id (slug). |
| season | integer | Season year. |
| Name | character | Player name. |
| Age | numeric | Player age during the season. |
| Level | character | League level (e.g. Maj-AL, Maj-NL). |
| Team | character | Team name. |
| G | numeric | Games played. |
| PA | numeric | Plate appearances. |
| AB | numeric | At-bats. |
| R | numeric | Runs scored. |
| H | numeric | Hits. |
| X1B | numeric | Singles. |
| X2B | numeric | Doubles. |
| X3B | numeric | Triples. |
| HR | numeric | Home runs. |
| RBI | numeric | Runs batted in. |
| BB | numeric | Walks (bases on balls). |
| IBB | numeric | Intentional walks. |
| uBB | numeric | Unintentional walks. |
| SO | numeric | Strikeouts. |
| HBP | numeric | Times hit by pitch. |
| SH | numeric | Sacrifice hits (bunts). |
| SF | numeric | Sacrifice flies. |
| GDP | numeric | Grounded into double plays. |
| SB | numeric | Stolen bases. |
| CS | numeric | Times caught stealing. |
| BA | numeric | Batting average. |
| OBP | numeric | On-base percentage. |
| SLG | numeric | Slugging percentage. |
| OPS | numeric | On-base plus slugging. |
try(bref_daily_batter(t1="2015-05-10", t2="2015-06-20"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.