Skip to contents

Find MLB Player Game Stats

Usage

mlb_player_game_stats(person_id = NULL, game_pk = NULL)

Arguments

person_id

MLBAMIDs for player of interest.

game_pk

The game_pk to return game_log statistics for a specific player in a specific game and to complete the call.

Value

Returns a tibble with the following columns:

col_nametypes
typecharacter
groupcharacter
assistsinteger
put_outsinteger
errorsinteger
chancesinteger
fieldingcharacter
caught_stealinginteger
passed_ballinteger
stolen_basesinteger
stolen_base_percentagecharacter
pickoffsinteger
games_playedinteger
games_startedinteger
fly_outsinteger
ground_outsinteger
air_outsinteger
runsinteger
doublesinteger
triplesinteger
home_runsinteger
strike_outsinteger
base_on_ballsinteger
intentional_walksinteger
hitsinteger
hit_by_pitchinteger
at_batsinteger
number_of_pitchesinteger
innings_pitchedcharacter
winsinteger
lossesinteger
savesinteger
save_opportunitiesinteger
holdsinteger
blown_savesinteger
earned_runsinteger
batters_facedinteger
outsinteger
games_pitchedinteger
complete_gamesinteger
shutoutsinteger
pitches_throwninteger
ballsinteger
strikesinteger
strike_percentagecharacter
hit_batsmeninteger
balksinteger
wild_pitchesinteger
rbiinteger
games_finishedinteger
runs_scored_per9character
home_runs_per9character
inherited_runnersinteger
inherited_runners_scoredinteger
catchers_interferenceinteger
sac_buntsinteger
sac_fliesinteger
ground_into_double_playinteger
ground_into_triple_playinteger
plate_appearancesinteger
total_basesinteger
left_on_baseinteger
at_bats_per_home_runcharacter
game_typecharacter
num_teamsinteger
avgcharacter
obpcharacter
slgcharacter
opscharacter
outs_pitchedinteger
whipcharacter
ground_outs_to_airoutscharacter
pitches_per_inningcharacter
strikeout_walk_ratiocharacter
strikeouts_per9inncharacter
walks_per9inncharacter
hits_per9inncharacter
team_idinteger
team_namecharacter
team_linkcharacter
opponent_idinteger
opponent_namecharacter
opponent_linkcharacter
pitcher_idinteger
pitcher_full_namecharacter
pitcher_linkcharacter
pitcher_first_namecharacter
pitcher_last_namecharacter
batter_idinteger
batter_full_namecharacter
batter_linkcharacter
batter_first_namecharacter
batter_last_namecharacter
total_splitsinteger
type_display_namecharacter
group_display_namecharacter
player_idnumeric
game_pknumeric

Examples

# \donttest{
 try(mlb_player_game_stats(person_id = 605151, game_pk = 531368))
#>   c("type", "group", "assists", "put_outs", "errors", "chances", "fielding", "caught_stealing", "passed_ball", "stolen_bases", "stolen_base_percentage", "pickoffs", "games_played", "games_started", "fly_outs", "ground_outs", "air_outs", "runs", "double ...
#> 1                                                                                                                                                                                                                                                        gameLog
#> 2                                                                                                                                                                                                                                                        gameLog
#> 3                                                                                                                                                                                                                                                        gameLog
#> 4                                                                                                                                                                                                                                                           <NA>
#>         NA NA NA NA NA   NA NA NA NA   NA NA NA NA NA NA NA NA NA NA NA
#> 1 fielding  0  0  0  0 .000  0  0  0 .---  0 NA NA NA NA NA NA NA NA NA
#> 2 pitching NA NA NA NA <NA>  0 NA  0 .---  0  1  0  1  2  1  0  0  0  0
#> 3  hitting NA NA NA NA <NA>  0 NA  0 .---  0  1 NA  0  0 NA  0  0  0  0
#> 4     <NA> NA NA NA NA <NA> NA NA NA <NA> NA  1 NA NA  1  0 NA  0  0  0
#>   NA NA NA NA NA NA NA   NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
#> 1 NA NA NA NA NA NA NA <NA> NA NA NA NA NA NA NA NA NA NA NA NA NA NA
#> 2  0  0  0  0  0  3  8  1.0  0  0  0  0  0  0  0  3  3  1  0  0  8  2
#> 3  0  0  0  0  0  0 NA <NA> NA NA NA NA NA NA NA NA NA NA NA NA NA NA
#> 4  0  0  0  0  0  1  2  0.1 NA NA NA NA NA NA NA  1  1  1 NA NA NA  0
#>   NA    NA NA NA NA NA NA   NA   NA NA NA NA NA NA NA NA NA NA NA   NA
#> 1 NA  <NA> NA NA NA NA NA <NA> <NA> NA NA NA NA NA NA NA NA NA NA <NA>
#> 2  6  .750  0  0  0  0  0 0.00 0.00  0  0  0  0  0 NA NA NA NA NA <NA>
#> 3 NA  <NA> NA NA NA  0 NA <NA> <NA> NA NA  0  0  0  0  0  0  0  0 -.--
#> 4  2 1.000  0  0  0  0 NA <NA> 0.00 NA NA  0  0  0  0 NA NA  0 NA <NA>
#>     NA NA   NA   NA   NA   NA NA   NA   NA   NA   NA   NA   NA   NA  NA
#> 1 <NA> NA <NA> <NA> <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>  NA
#> 2 <NA> NA <NA> <NA> <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>  NA
#> 3 <NA> NA <NA> <NA> <NA> <NA> NA <NA> <NA> <NA> <NA> <NA> <NA> <NA>  NA
#> 4    R  1 .000 .000 .000 .000  1 0.00 1.00 6.00 -.-- 0.00 0.00 0.00 109
#>                     NA                NA  NA               NA
#> 1                 <NA>              <NA>  NA             <NA>
#> 2                 <NA>              <NA>  NA             <NA>
#> 3                 <NA>              <NA>  NA             <NA>
#> 4 Arizona Diamondbacks /api/v1/teams/109 136 Seattle Mariners
#>                  NA     NA             NA                    NA     NA
#> 1              <NA>     NA           <NA>                  <NA>   <NA>
#> 2              <NA>     NA           <NA>                  <NA>   <NA>
#> 3              <NA>     NA           <NA>                  <NA>   <NA>
#> 4 /api/v1/teams/136 605151 Archie Bradley /api/v1/people/605151 Archie
#>        NA     NA            NA                    NA       NA   NA NA
#> 1    <NA>     NA          <NA>                  <NA>     <NA> <NA> NA
#> 2    <NA>     NA          <NA>                  <NA>     <NA> <NA> NA
#> 3    <NA>     NA          <NA>                  <NA>     <NA> <NA> NA
#> 4 Bradley 429664 Robinson Cano /api/v1/people/429664 Robinson Cano  1
#>           NA       NA     NA     NA
#> 1       <NA>     <NA> 605151 531368
#> 2       <NA>     <NA> 605151 531368
#> 3       <NA>     <NA> 605151 531368
#> 4 vsPlayer5Y pitching 605151 531368
# }