Learn R Programming

baseballr (version 1.6.0)

bref_team_results: Scrape Team Results

Description

This function allows you to scrape schedule and results for a major league team from Baseball-Reference.com

Usage

bref_team_results(Tm, year)

Value

Returns a tibble of MLB team results and the following columns:

col_nametypes
Gmnumeric
Datecharacter
Tmcharacter
H_Acharacter
Oppcharacter
Resultcharacter
Rnumeric
RAnumeric
Inncharacter
Recordcharacter
Ranknumeric
GBcharacter
Wincharacter
Losscharacter
Savecharacter
Timecharacter
D/Ncharacter
Attendancenumeric
cLInumeric
Streaknumeric
Orig_Scheduledcharacter
Yearnumeric

Arguments

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.

Examples

Run this code
# \donttest{
  try(bref_team_results("NYM", 2015))
  try(bref_team_results(Tm="TBR", year=2008))
# }

Run the code above in your browser using DataLab