(legacy) Scrape Batter Leaderboards from FanGraphs
fg_bat_leaders(x, y, league = "all", qual = "y", ind = 1, exc_p = TRUE)
A data frame of batter data.
First season for which you want data.
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.
Option for limiting results to different leagues or overall results. Options are "al", "nl", or "all".
Whether you want only batters/pitchers that qualified in a given season, or the minimum number of plate appearances for inclusion. If you only want qualified hitters, use qual. If a minimum number of plate appearaces/innings pitched, use the number desired. Defaults to "y".
Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.
(logical) Whether or not to exclude pitchers from the batter leaderboards. TRUE = exclude pitchers, FALSE = retain pitchers.