Skip to contents

MLB Standings

Usage

mlb_standings(
  season = NULL,
  date = NULL,
  standings_type = NULL,
  league_id = NULL
)

Arguments

season

Year(s) to return to return standings information for.

date

Date to return to return standings information for.

standings_type

The standings_type(s) to return standings information for. Description of all standings_types

  1. regularSeason - Regular Season Standings

  2. wildCard - Wild card standings

  3. divisionLeaders - Division Leader standings

  4. wildCardWithLeaders - Wild card standings with Division Leaders

  5. firstHalf - First half standings. Only valid for leagues with a split season (Mexican League).

  6. secondHalf - Second half standings. Only valid for leagues with a split season (Mexican League).

  7. springTraining - Spring Training Standings

  8. postseason - Postseason Standings

  9. byDivision - Standings by Division

  10. byConference - Standings by Conference

  11. byLeague - Standings by League

league_id

The league_id(s) to return standings information for.

Value

Returns a tibble with the following columns

col_nametypes
standings_typecharacter
last_updatedcharacter
team_records_seasoncharacter
team_records_clinch_indicatorcharacter
team_records_division_rankcharacter
team_records_league_rankcharacter
team_records_sport_rankcharacter
team_records_games_playedinteger
team_records_games_backcharacter
team_records_wild_card_games_backcharacter
team_records_league_games_backcharacter
team_records_spring_league_games_backcharacter
team_records_sport_games_backcharacter
team_records_division_games_backcharacter
team_records_conference_games_backcharacter
team_records_last_updatedcharacter
team_records_runs_allowedinteger
team_records_runs_scoredinteger
team_records_division_champlogical
team_records_division_leaderlogical
team_records_has_wildcardlogical
team_records_clinchedlogical
team_records_elimination_numbercharacter
team_records_wild_card_elimination_numbercharacter
team_records_magic_numbercharacter
team_records_winsinteger
team_records_lossesinteger
team_records_run_differentialinteger
team_records_winning_percentagecharacter
team_records_wild_card_rankcharacter
team_records_wild_card_leaderlogical
team_records_team_idinteger
team_records_team_namecharacter
team_records_team_linkcharacter
team_records_streak_streak_typecharacter
team_records_streak_streak_numberinteger
team_records_streak_streak_codecharacter
team_records_league_record_winsinteger
team_records_league_record_lossesinteger
team_records_league_record_tiesinteger
team_records_league_record_pctcharacter
team_records_records_split_recordslist
team_records_records_division_recordslist
team_records_records_overall_recordslist
team_records_records_league_recordslist
team_records_records_expected_recordslist
league_idinteger
league_linkcharacter
division_idinteger
division_linkcharacter
sport_idinteger
sport_linkcharacter

Examples

# \donttest{
  try(mlb_standings(season = 2021, league_id = 103))
#> ── MLB Standings data from MLB.com ────────────────── baseballr 1.2.0 ──
#>  Data updated: 2022-04-30 07:16:37 UTC
#> # A tibble: 15 × 52
#>    standings_type last_updated         team_records_se… team_records_cl…
#>    <chr>          <chr>                <chr>            <chr>           
#>  1 regularSeason  2022-03-14T05:15:01… 2021             z               
#>  2 regularSeason  2022-03-14T05:15:01… 2021             w               
#>  3 regularSeason  2022-03-14T05:15:01… 2021             w               
#>  4 regularSeason  2022-03-14T05:15:01… 2021             NA              
#>  5 regularSeason  2022-03-14T05:15:01… 2021             NA              
#>  6 regularSeason  2022-03-31T19:50:45… 2021             y               
#>  7 regularSeason  2022-03-31T19:50:45… 2021             NA              
#>  8 regularSeason  2022-03-31T19:50:45… 2021             NA              
#>  9 regularSeason  2022-03-31T19:50:45… 2021             NA              
#> 10 regularSeason  2022-03-31T19:50:45… 2021             NA              
#> 11 regularSeason  2022-03-14T05:14:55… 2021             y               
#> 12 regularSeason  2022-03-14T05:14:55… 2021             NA              
#> 13 regularSeason  2022-03-14T05:14:55… 2021             NA              
#> 14 regularSeason  2022-03-14T05:14:55… 2021             NA              
#> 15 regularSeason  2022-03-14T05:14:55… 2021             NA              
#> # … with 48 more variables: team_records_division_rank <chr>,
#> #   team_records_league_rank <chr>, team_records_sport_rank <chr>,
#> #   team_records_games_played <int>, team_records_games_back <chr>,
#> #   team_records_wild_card_games_back <chr>,
#> #   team_records_league_games_back <chr>,
#> #   team_records_spring_league_games_back <chr>,
#> #   team_records_sport_games_back <chr>, …
# }