Skip to contents

MLB Teams

Usage

mlb_teams(
  season = NULL,
  active_status = NULL,
  all_star_statuses = NULL,
  league_ids = NULL,
  sport_ids = NULL,
  game_type = NULL
)

Arguments

season

Year to return to return team information for.

active_status

The active statuses to populate teams for a given season.

all_star_statuses

The all-star statuses to populate teams for a given season.

league_ids

The league_id(s) to return team information for.

sport_ids

The sport_id(s) to return team information for.

game_type

The game_type to return team information for.

Value

Returns a tibble with the following columns

col_nametypes
team_idinteger
team_full_namecharacter
linkcharacter
seasoninteger
team_codecharacter
file_codecharacter
team_abbreviationcharacter
team_namecharacter
location_namecharacter
first_year_of_playcharacter
short_namecharacter
franchise_namecharacter
club_namecharacter
all_star_statuscharacter
activelogical
venue_idinteger
venue_namecharacter
venue_linkcharacter
spring_venue_idinteger
spring_venue_linkcharacter
league_idinteger
league_namecharacter
league_linkcharacter
division_idinteger
division_namecharacter
division_linkcharacter
sport_idinteger
sport_linkcharacter
sport_namecharacter
spring_league_idinteger
spring_league_namecharacter
spring_league_linkcharacter
spring_league_abbreviationcharacter

Examples

# \donttest{
  try(mlb_teams(season = 2021, sport_ids = c(1)))
#> ── MLB Teams data from MLB.com ────────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:52 UTC
#> # A tibble: 30 × 33
#>    all_star_status team_id team_full_name       link    season team_code
#>    <chr>             <int> <chr>                <chr>    <int> <chr>    
#>  1 N                   133 Oakland Athletics    /api/v…   2021 oak      
#>  2 N                   134 Pittsburgh Pirates   /api/v…   2021 pit      
#>  3 N                   135 San Diego Padres     /api/v…   2021 sdn      
#>  4 N                   136 Seattle Mariners     /api/v…   2021 sea      
#>  5 N                   137 San Francisco Giants /api/v…   2021 sfn      
#>  6 N                   138 St. Louis Cardinals  /api/v…   2021 sln      
#>  7 N                   139 Tampa Bay Rays       /api/v…   2021 tba      
#>  8 N                   140 Texas Rangers        /api/v…   2021 tex      
#>  9 N                   141 Toronto Blue Jays    /api/v…   2021 tor      
#> 10 N                   142 Minnesota Twins      /api/v…   2021 min      
#> # ℹ 20 more rows
#> # ℹ 27 more variables: file_code <chr>, team_abbreviation <chr>,
#> #   team_name <chr>, location_name <chr>, first_year_of_play <chr>,
#> #   short_name <chr>, franchise_name <chr>, club_name <chr>,
#> #   active <lgl>, spring_league_id <int>, spring_league_name <chr>,
#> #   spring_league_link <chr>, spring_league_abbreviation <chr>,
#> #   venue_id <int>, venue_name <chr>, venue_link <chr>, …
# }