Skip to contents

Retrieve game linescores for major and minor league games

Usage

mlb_game_linescore(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble with the following columns

col_nametypes
game_pknumeric
home_team_idcharacter
home_team_namecharacter
away_team_idcharacter
away_team_namecharacter
numinteger
ordinal_numcharacter
home_runsinteger
home_hitsinteger
home_errorsinteger
home_left_on_baseinteger
away_runsinteger
away_hitsinteger
away_errorsinteger
away_left_on_baseinteger
home_team_linkcharacter
home_team_seasoncharacter
home_team_venue_idcharacter
home_team_venue_namecharacter
home_team_venue_linkcharacter
home_team_team_codecharacter
home_team_file_codecharacter
home_team_abbreviationcharacter
home_team_team_namecharacter
home_team_location_namecharacter
home_team_first_year_of_playcharacter
home_team_league_idcharacter
home_team_league_namecharacter
home_team_league_linkcharacter
home_team_division_idcharacter
home_team_division_namecharacter
home_team_division_linkcharacter
home_team_sport_idcharacter
home_team_sport_linkcharacter
home_team_sport_namecharacter
home_team_short_namecharacter
home_team_record_games_playedcharacter
home_team_record_wild_card_games_backcharacter
home_team_record_league_games_backcharacter
home_team_record_spring_league_games_backcharacter
home_team_record_sport_games_backcharacter
home_team_record_division_games_backcharacter
home_team_record_conference_games_backcharacter
home_team_record_league_record_winscharacter
home_team_record_league_record_lossescharacter
home_team_record_league_record_pctcharacter
home_team_record_division_leadercharacter
home_team_record_winscharacter
home_team_record_lossescharacter
home_team_record_winning_percentagecharacter
home_team_franchise_namecharacter
home_team_club_namecharacter
home_team_all_star_statuscharacter
home_team_activecharacter
away_team_linkcharacter
away_team_seasoncharacter
away_team_venue_idcharacter
away_team_venue_namecharacter
away_team_venue_linkcharacter
away_team_team_codecharacter
away_team_file_codecharacter
away_team_abbreviationcharacter
away_team_team_namecharacter
away_team_location_namecharacter
away_team_first_year_of_playcharacter
away_team_league_idcharacter
away_team_league_namecharacter
away_team_league_linkcharacter
away_team_division_idcharacter
away_team_division_namecharacter
away_team_division_linkcharacter
away_team_sport_idcharacter
away_team_sport_linkcharacter
away_team_sport_namecharacter
away_team_short_namecharacter
away_team_record_games_playedcharacter
away_team_record_wild_card_games_backcharacter
away_team_record_league_games_backcharacter
away_team_record_spring_league_games_backcharacter
away_team_record_sport_games_backcharacter
away_team_record_division_games_backcharacter
away_team_record_conference_games_backcharacter
away_team_record_league_record_winscharacter
away_team_record_league_record_lossescharacter
away_team_record_league_record_pctcharacter
away_team_record_division_leadercharacter
away_team_record_winscharacter
away_team_record_lossescharacter
away_team_record_winning_percentagecharacter
away_team_franchise_namecharacter
away_team_club_namecharacter
away_team_all_star_statuscharacter
away_team_activecharacter

Examples

# \donttest{
  try(mlb_game_linescore(game_pk = 566001))
#> ── MLB Game Linescore data from MLB.com ───────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:16 UTC
#> # A tibble: 9 × 95
#>   game_pk home_team_id home_team_name away_team_id away_team_name    num
#>     <dbl> <chr>        <chr>          <chr>        <chr>           <int>
#> 1  566001 121          New York Mets  113          Cincinnati Reds     1
#> 2  566001 121          New York Mets  113          Cincinnati Reds     2
#> 3  566001 121          New York Mets  113          Cincinnati Reds     3
#> 4  566001 121          New York Mets  113          Cincinnati Reds     4
#> 5  566001 121          New York Mets  113          Cincinnati Reds     5
#> 6  566001 121          New York Mets  113          Cincinnati Reds     6
#> 7  566001 121          New York Mets  113          Cincinnati Reds     7
#> 8  566001 121          New York Mets  113          Cincinnati Reds     8
#> 9  566001 121          New York Mets  113          Cincinnati Reds     9
#> # ℹ 89 more variables: ordinal_num <chr>, home_runs <int>,
#> #   home_hits <int>, home_errors <int>, home_left_on_base <int>,
#> #   away_runs <int>, away_hits <int>, away_errors <int>,
#> #   away_left_on_base <int>, home_team_all_star_status <chr>,
#> #   home_team_link <chr>, home_team_season <chr>,
#> #   home_team_venue_id <chr>, home_team_venue_name <chr>,
#> #   home_team_venue_link <chr>, home_team_team_code <chr>, …
# }