Skip to contents

Retrieve batting orders for a given MLB game

Usage

mlb_batting_orders(game_pk, type = "starting")

Arguments

game_pk

The unique game_pk identifier for the game

type

Whether to just return the starting lineup ('starting') or all batters that appeared ('all')

Value

Returns a tibble that includes probable starting pitchers and the home plate umpire for the game_pk requested

col_nametypes
idinteger
fullNamecharacter
abbreviationcharacter
batting_ordercharacter
batting_position_numcharacter
teamcharacter
teamNamecharacter
teamIDinteger

Examples

# \donttest{
  try(mlb_batting_orders(game_pk=566001))
#> ── MLB Game Starting Batting Order data from MLB.com ───────────────────
#>  Data updated: 2022-04-30 07:15:45 UTC
#> # A tibble: 18 × 8
#>        id fullName     abbreviation batting_order batting_positio… team 
#>     <int> <chr>        <chr>        <chr>         <chr>            <chr>
#>  1 606299 Jose Peraza  2B           1             0                away 
#>  2 458015 Joey Votto   1B           2             0                away 
#>  3 553993 Eugenio Sua… 3B           3             0                away 
#>  4 608385 Jesse Winker LF           4             0                away 
#>  5 624577 Yasiel Puig  RF           5             0                away 
#>  6 594988 Scott Scheb… CF           6             0                away 
#>  7 578428 Jose Iglesi… SS           7             0                away 
#>  8 571466 Tucker Barn… C            8             0                away 
#>  9 543699 Tanner Roark P            9             0                away 
#> 10 643446 Jeff McNeil  2B           1             0                home 
#> 11 624413 Pete Alonso  1B           2             0                home 
#> 12 607043 Brandon Nim… LF           3             0                home 
#> 13 624424 Michael Con… RF           4             0                home 
#> 14 453943 Todd Frazier 3B           5             0                home 
#> 15 467092 Wilson Ramos C            6             0                home 
#> 16 642708 Amed Rosario SS           7             0                home 
#> 17 501571 Juan Lagares CF           8             0                home 
#> 18 554430 Zack Wheeler P            9             0                home 
#> # … with 2 more variables: teamName <chr>, teamID <int>
# }