Description Usage Arguments Value See Also Examples
View source: R/tm_plyr_batting.R
Allows the user to scrape leaderboard batting statistics by team and season from http://www.fangraphs.com.
1 2 | tm_plyr_batting(team, year, min_pa = 0, start_year = NULL,
end_year = NULL)
|
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. |
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.
team_specific_fill
for details on appropriate team values
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.