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))
#> ── MLB Player Game Stats data from MLB.com ────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:37 UTC
#> # A tibble: 3 × 69
#>   type    group    caught_stealing stolen_bases stolen_base_percentage
#>   <chr>   <chr>              <int>        <int> <chr>                 
#> 1 gameLog fielding               0            0 .---                  
#> 2 gameLog pitching               0            0 .---                  
#> 3 gameLog hitting                0            0 .---                  
#> # ℹ 64 more variables: assists <int>, put_outs <int>, errors <int>,
#> #   chances <int>, fielding <chr>, passed_ball <int>, pickoffs <int>,
#> #   summary <chr>, games_played <int>, games_started <int>,
#> #   fly_outs <int>, ground_outs <int>, air_outs <int>, runs <int>,
#> #   doubles <int>, triples <int>, home_runs <int>, strike_outs <int>,
#> #   base_on_balls <int>, intentional_walks <int>, hits <int>,
#> #   hit_by_pitch <int>, at_bats <int>, number_of_pitches <int>, …
# }