Skip to contents

MLB Team Affiliates

Usage

mlb_team_affiliates(team_ids = NULL, sport_ids = NULL, season = NULL)

Arguments

team_ids

The team_id(s) to return affiliates data for.

sport_ids

The sport_id to return team affiliates information for.

season

The season to return team affiliates data for the particular season.

Value

Returns a tibble with the following columns

col_nametypes
all_star_statuscharacter
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
activelogical
parent_org_namecharacter
parent_org_idinteger
spring_league_idinteger
spring_league_namecharacter
spring_league_linkcharacter
spring_league_abbreviationcharacter
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

Examples

# \donttest{
  try(mlb_team_affiliates(team_ids = 147))
#> ── MLB Team Affiliates data from MLB.com ──────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:48 UTC
#> # A tibble: 11 × 35
#>    all_star_status team_id team_full_name         link  season team_code
#>    <chr>             <int> <chr>                  <chr>  <int> <chr>    
#>  1 N                   147 New York Yankees       /api…   2024 nya      
#>  2 N                  1956 Somerset Patriots      /api…   2024 som      
#>  3 N                   587 Tampa Tarpons          /api…   2024 tpa      
#>  4 F                   386 New York Yankees Pros… /api…   2024 nyf      
#>  5 N                  3308 Yankees Alternate Tra… /api…   2024 nys      
#>  6 O                  3309 Yankees Organization   /api…   2024 nyo      
#>  7 N                   475 FCL Yankees            /api…   2024 fya      
#>  8 N                   531 Scranton/Wilkes-Barre… /api…   2024 swb      
#>  9 N                   635 DSL NYY Yankees        /api…   2024 dya      
#> 10 N                   634 DSL NYY Bombers        /api…   2024 dyb      
#> 11 N                   537 Hudson Valley Renegad… /api…   2024 hvr      
#> # ℹ 29 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>, parent_org_name <chr>, parent_org_id <int>,
#> #   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>, …
# }