tm_plyr_batting: Scraping Team Specific Fangraphs batter statistics

Description Usage Arguments Value See Also Examples

View source: R/tm_plyr_batting.R

Description

Allows the user to scrape leaderboard batting statistics by team and season from http://www.fangraphs.com.

Usage

1
2
tm_plyr_batting(team, year, min_pa = 0, start_year = NULL,
  end_year = NULL)

Arguments

team

Specify the team abbreviation as character value

year

Specify numeric year from which to pull. Default is to take the current year if the season has started. Or the most recent year if the season is over.

min_pa

Minimum number of plate appearances for batters. Default is 0 and takes on values up to 1000. To see only qualified hitters use 'y'.

start_year

Numeric value indicating the first year from which you want to pull data

end_year

Numeric value indicating the last year to pull for a year range.

Value

data.frame object on the team hitters with the main statistics referenced on the fangraphs batting leaderboard. When pulling multiple seasons the data.frame is ordered not by season but by WAR value in descending order.

See Also

team_specific_fill for details on appropriate team values

Examples

1
2
3
#reading in batters with at least 200 PA for the Boston Red Sox from 2003 to 2010
bos_batting <- tm_plyr_batting("BOS", start_year = 2003, end_year= 2010, min_pa = 200)
head(bos_batting)

williazo/rwindow.baseball documentation built on May 29, 2019, 11:47 a.m.