View source: R/bref_team_results.R
| bref_team_results | R Documentation |
This function allows you to scrape schedule and results for a major league team from Baseball-Reference.com
bref_team_results(Tm, year)
Tm |
The abbreviation used by Baseball-Reference.com for the team whose results you want to scrape. |
year |
Season for which you want to scrape the park factors. |
Returns a tibble of MLB team results, one row per game on the team's schedule, with the following columns:
| col_name | types | description |
| Gm | character | Game number / label in the schedule (includes postseason labels). |
| Date | character | Day-of-week and calendar date of the game. |
| Tm | character | Team abbreviation. |
| H_A | character | Home/away indicator (A denotes a road game). |
| Opp | character | Opponent team abbreviation. |
| Result | character | Game outcome from the team's perspective (W/L). |
| R | integer | Runs scored by the team. |
| RA | integer | Runs allowed (opponent runs). |
| Inn | integer | Innings played when not nine (e.g. extra innings). |
| Record | character | Team's cumulative win-loss record after the game. |
| Rank | character | Team's standing/rank in its division after the game. |
| GB | character | Games behind the division leader after the game. |
| Win | character | Winning pitcher. |
| Loss | character | Losing pitcher. |
| Save | character | Pitcher credited with the save (N if none). |
| Time | character | Duration of the game. |
| D/N | character | Day (D) or night (N) game. |
| Attendance | numeric | Announced attendance. |
| cLI | numeric | Championship leverage index of the game. |
| Streak | character | Win/loss streak entering the game. |
| Orig_Scheduled | character | Original scheduled date (for rescheduled games). |
| Year | numeric | Season year. |
try(bref_team_results("NYM", 2015))
try(bref_team_results(Tm="TBR", year=2008))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.