fg_pitch_leaders: Scrape Pitcher Leaderboards from FanGraphs
Description
This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.
Usage
fg_pitch_leaders(x, y, league = "all", qual = "y",
pitcher_type = "pit", ind = 0)
Arguments
x
First season for which you want data.
y
Last season for which you want data. If multiple years selected, data returned will be aggregate data for the date range. If y = x, function will return single-season data.
league
Option for limiting results to different leagues or overall results. Options are "al", "nl", or "all".
qual
Whether you want only pitchers that qualified in a given season, or the minimum number of innings pitched for inclusion. If you only want qualified pitchers, use qual. If a minimumm number of innings pitches, use the number desired. Defaults to "y".
pitcher_type
Whether you want only starting pitchers, relievers, or all pitchers that meet the criteria specified in the qual argument. Options include "pit", "sta", "rel".
ind
Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.