Skip to contents

Acquire time codes for Major and Minor League games

Usage

mlb_game_changes(updated_since, sport_id)

Arguments

updated_since

Updated since date time

sport_id

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

Value

Returns a tibble that includes time codes from the game_pk requested

col_nametypes
datecharacter
total_itemsinteger
total_eventsinteger
total_gamesinteger
total_games_in_progressinteger
game_pkinteger
linkcharacter
game_typecharacter
seasoncharacter
game_datecharacter
official_datecharacter
is_tielogical
game_numberinteger
public_facinglogical
double_headercharacter
gameday_typecharacter
tiebreakercharacter
calendar_event_idcharacter
season_displaycharacter
day_nightcharacter
descriptioncharacter
scheduled_inningsinteger
reverse_home_away_statuslogical
inning_break_lengthinteger
games_in_seriesinteger
series_game_numberinteger
series_descriptioncharacter
record_sourcecharacter
if_necessarycharacter
if_necessary_descriptioncharacter
status_abstract_game_statecharacter
status_coded_game_statecharacter
status_detailed_statecharacter
status_status_codecharacter
status_start_time_tbdlogical
status_abstract_game_codecharacter
teams_away_scoreinteger
teams_away_is_winnerlogical
teams_away_split_squadlogical
teams_away_series_numberinteger
teams_away_league_record_winsinteger
teams_away_league_record_lossesinteger
teams_away_league_record_pctcharacter
teams_away_team_idinteger
teams_away_team_namecharacter
teams_away_team_linkcharacter
teams_home_scoreinteger
teams_home_is_winnerlogical
teams_home_split_squadlogical
teams_home_series_numberinteger
teams_home_league_record_winsinteger
teams_home_league_record_lossesinteger
teams_home_league_record_pctcharacter
teams_home_team_idinteger
teams_home_team_namecharacter
teams_home_team_linkcharacter
venue_idinteger
venue_namecharacter
venue_linkcharacter
content_linkcharacter
status_reasoncharacter
rescheduled_fromcharacter
rescheduled_from_datecharacter
resumed_fromcharacter
resumed_from_datecharacter
eventslist

Examples

# \donttest{
  try(mlb_game_changes(updated_since = "2021-08-10T19:08:24.000004Z", sport_id = 1))
#> ── MLB Game Changes data from MLB.com ─────────────── baseballr 1.2.0 ──
#>  Data updated: 2022-04-30 07:15:55 UTC
#> # A tibble: 1,000 × 66
#>    date    total_items total_events total_games total_games_in_… game_pk
#>    <chr>         <int>        <int>       <int>            <int>   <int>
#>  1 1999-0…           1            0           1                0     916
#>  2 1999-0…           1            0           1                0     200
#>  3 1999-0…           1            0           1                0    2914
#>  4 1999-0…           1            0           1                0    1404
#>  5 1999-0…           1            0           1                0    1504
#>  6 1999-0…           2            0           2                0     526
#>  7 1999-0…           2            0           2                0     602
#>  8 1999-0…           1            0           1                0     529
#>  9 1999-0…           1            0           1                0     690
#> 10 1999-0…           1            0           1                0    1317
#> # … with 990 more rows, and 60 more variables: link <chr>,
#> #   game_type <chr>, season <chr>, game_date <chr>,
#> #   official_date <chr>, is_tie <lgl>, game_number <int>,
#> #   public_facing <lgl>, double_header <chr>, gameday_type <chr>,
#> #   tiebreaker <chr>, calendar_event_id <chr>, season_display <chr>,
#> #   day_night <chr>, description <chr>, scheduled_innings <int>,
#> #   reverse_home_away_status <lgl>, inning_break_length <int>, …
# }