MLB Stats Leaders
mlb_stats_leaders(
leader_categories = NULL,
player_pool = NULL,
leader_game_types = NULL,
sit_codes = NULL,
position = NULL,
stat_group = NULL,
season = NULL,
league_id = NULL,
sport_id = NULL,
start_date = NULL,
end_date = NULL,
stat_type = NULL,
limit = 1000
)
Returns a tibble with the following columns
col_name | types |
leader_category | character |
rank | integer |
value | character |
season | character |
num_teams | integer |
team_id | integer |
team_name | character |
team_link | character |
league_id | integer |
league_name | character |
league_link | character |
person_id | integer |
person_full_name | character |
person_link | character |
person_first_name | character |
person_last_name | character |
sport_id | integer |
sport_link | character |
sport_abbreviation | character |
stat_group | character |
total_splits | integer |
game_type_id | character |
game_type_description | character |
League leader category to return information and ranking for a particular statistic.
There are 4 different types of player pools to return statistics for a particular player pool across a sport. Acceptable values include: All, Qualified, Rookies, or Qualified_rookies
Game type to return information and ranking for a particular statistic in a particular game type.
Situation code to return information and ranking for a particular statistic in a particular game type.
Position to return statistics for a given position. Default to "Qualified" player pool Acceptable values include:
P
C
1B
2B
3B
SS
LF
CF
RF
DH
PH
PR
BR
OF
IF
SP
RP
CP
UT
UI
UO
RHP
LHP
RHS
LHS
LHR
RHR
B
X
Stat group to return information and ranking for a particular statistic in a particular group.
Year to return information and ranking for a particular statistic in a given year.
League ID to return statistics for a given league. Default to "Qualified" player pool.
The sport_id to return information and ranking information for.
Start date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY start_date must be coupled with end_date and byDateRange stat_type
End date to return information and ranking for a particular statistic for a particular date range. Format: MM/DD/YYYY end_date must be coupled with start_date and byDateRange stat_type
The stat_type to return information and ranking for a particular statistic for a particular stat type.
A limit to limit return to a particular number of records.
# \donttest{
try(mlb_stats_leaders(leader_categories='homeRuns',sport_id=1, season = 2021))
# }
Run the code above in your browser using DataLab