MLB Teams Stats
Usage
mlb_teams_stats(
  stat_type = NULL,
  game_type = NULL,
  stat_group = NULL,
  season = NULL,
  sport_ids = NULL,
  sort_stat = NULL,
  order = NULL
)Arguments
- stat_type
 Stat type to return statistics for.
- game_type
 Game type to return information for a particular statistic in a particular game type.
- stat_group
 Stat group to return information and ranking for a particular statistic in a particular group.
- season
 Year to return information and ranking for a particular statistic in a given year.
- sport_ids
 The sport_id(s) to return information and ranking information for.
- sort_stat
 Sort return based on stat.
- order
 Order return based on either desc or asc.
Value
Returns a tibble with the following columns
| col_name | types | 
| total_splits | integer | 
| season | character | 
| rank | integer | 
| games_played | integer | 
| ground_outs | integer | 
| air_outs | integer | 
| runs | integer | 
| doubles | integer | 
| triples | integer | 
| home_runs | integer | 
| strike_outs | integer | 
| base_on_balls | integer | 
| intentional_walks | integer | 
| hits | integer | 
| hit_by_pitch | integer | 
| avg | character | 
| at_bats | integer | 
| obp | character | 
| slg | character | 
| ops | character | 
| caught_stealing | integer | 
| stolen_bases | integer | 
| stolen_base_percentage | character | 
| ground_into_double_play | integer | 
| number_of_pitches | integer | 
| plate_appearances | integer | 
| total_bases | integer | 
| rbi | integer | 
| left_on_base | integer | 
| sac_bunts | integer | 
| sac_flies | integer | 
| babip | character | 
| ground_outs_to_airouts | character | 
| catchers_interference | integer | 
| at_bats_per_home_run | character | 
| team_id | integer | 
| team_name | character | 
| team_link | character | 
| splits_tied_with_offset | list | 
| splits_tied_with_limit | list | 
| type_display_name | character | 
| group_display_name | character | 
Examples
# \donttest{
  try(mlb_teams_stats(stat_type = 'season', stat_group = 'hitting', season = 2021))
#> ── MLB Teams Stats data from MLB.com ──────────────── baseballr 1.6.0 ──
#> ℹ Data updated: 2024-04-13 21:56:53 UTC
#> # A tibble: 50 × 42
#>    total_splits season  rank games_played ground_outs air_outs  runs
#>           <int> <chr>  <int>        <int>       <int>    <int> <int>
#>  1          370 2021       1            2           8        6    10
#>  2          370 2021       2            2          14       19    18
#>  3          370 2021       3            2          14        8     9
#>  4          370 2021       4            1           4       17     7
#>  5          370 2021       5            2          18       15    19
#>  6          370 2021       6            1           9        7    13
#>  7          370 2021       7           63         546      495   500
#>  8          370 2021       8            1           8        4     9
#>  9          370 2021       9            3          24       26    23
#> 10          370 2021      10           66         593      594   438
#> # ℹ 40 more rows
#> # ℹ 35 more variables: doubles <int>, triples <int>, home_runs <int>,
#> #   strike_outs <int>, base_on_balls <int>, intentional_walks <int>,
#> #   hits <int>, hit_by_pitch <int>, avg <chr>, at_bats <int>,
#> #   obp <chr>, slg <chr>, ops <chr>, caught_stealing <int>,
#> #   stolen_bases <int>, stolen_base_percentage <chr>,
#> #   ground_into_double_play <int>, number_of_pitches <int>, …
# }
