Skip to contents

MLB Divisions

Usage

mlb_divisions(division_id = NULL, league_id = NULL, sport_id = NULL)

Arguments

division_id

Return division(s) data for a specific division

league_id

Return division(s) data for all divisions in a specific league

sport_id

Return division(s) for all divisions in a specific sport.

Value

Returns a tibble with the following columns

col_nametypes
division_idinteger
division_namecharacter
seasoncharacter
division_name_shortcharacter
division_linkcharacter
division_abbreviationcharacter
has_wildcardlogical
sort_orderinteger
num_playoff_teamsinteger
activelogical
league_idinteger
league_linkcharacter
sport_idinteger
sport_linkcharacter

Examples

# \donttest{
  try(mlb_divisions(sport_id = 1))
#> ── MLB Divisions data from MLB.com ────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:06 UTC
#> # A tibble: 6 × 14
#>   division_id division_name     season division_name_short division_link
#>         <int> <chr>             <chr>  <chr>               <chr>        
#> 1         200 American League … 2024   AL West             /api/v1/divi…
#> 2         201 American League … 2024   AL East             /api/v1/divi…
#> 3         202 American League … 2024   AL Central          /api/v1/divi…
#> 4         203 National League … 2024   NL West             /api/v1/divi…
#> 5         204 National League … 2024   NL East             /api/v1/divi…
#> 6         205 National League … 2024   NL Central          /api/v1/divi…
#> # ℹ 9 more variables: division_abbreviation <chr>, has_wildcard <lgl>,
#> #   sort_order <int>, num_playoff_teams <int>, active <lgl>,
#> #   league_id <int>, league_link <chr>, sport_id <int>,
#> #   sport_link <chr>
# }