mlb_high_low_stats function

Acquire high/low stats for Major and Minor Leagues

Acquire high/low stats for Major and Minor Leagues

mlb_high_low_stats( org_type, season, sort_stat, team_ids = NULL, league_ids = NULL, sport_ids = NULL, game_type = NULL, stat_group = NULL, limit = NULL )

Arguments

  • org_type: The organization type for return information (Required). Valid values include:

    • player
    • team
    • division
    • league
    • sport
  • season: The season for which you want to return information (Required).

  • sort_stat: The stat to sort the return (Required). Valid values can be found from 'stat_lookup_param' below

    stat_namestat_lookup_paramis_countingstat_labelstat_groupsorg_typeshigh_low_types
    at_batsatBatsTRUEAt batshitting , pitchingPLAYER, TEAMPLAYER, TEAM , GAME
    total_plate_appearancesplateAppearancesTRUETotal plate appearanceshittingPLAYER, TEAMPLAYER, TEAM , GAME
    runsrunsTRUERunshittingPLAYER, TEAMPLAYER, TEAM , GAME
    runs_batted_inrbiTRUERuns batted inhittingPLAYER, TEAMPLAYER, TEAM , GAME
    home_team_runsrunsTRUEHome team runshittingTEAMGAME
    away_team_runsrunsTRUEAway team runshittingTEAMGAME
    hitshitsTRUEHitshittingPLAYER, TEAMPLAYER, TEAM , GAME
    hits_risphitsRispTRUEHits risphittingPLAYER, TEAMPLAYER, TEAM
    home_team_hitshitsTRUEHome team hitshittingTEAMGAME
    away_team_hitshitsTRUEAway team hitshittingTEAMGAME
    total_basestotalBasesTRUETotal baseshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    doublesdoublesTRUEDoubleshitting , pitchingPLAYER, TEAMPLAYER, TEAM , GAME
    triplestriplesTRUETripleshittingPLAYER, TEAMPLAYER, TEAM , GAME
    home_runshomeRunsTRUEHome runshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    extra_base_hitsextraBaseHitsTRUEExtra base hitshittingPLAYER, TEAMPLAYER, TEAM
    walksbaseOnBallsTRUEWalkshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    strikeoutsstrikeoutsTRUEStrikeoutshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    stolen_basesstolenBasesTRUEStolen baseshittingPLAYER, TEAMPLAYER, TEAM
    caught_stealingcaughtStealingTRUECaught stealinghitting , pitching, fieldingPLAYER, TEAMPLAYER, TEAM
    sacrifice_fliessacFliesTRUESacrifice flieshittingPLAYER, TEAMPLAYER, TEAM
    sacrifice_buntssacBuntsTRUESacrifice buntshittingPLAYER, TEAMPLAYER, TEAM
    hit_by_pitcheshitByPitchTRUEHit by pitcheshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    left_on_baseleftOnBaseTRUELeft on basehittingPLAYER, TEAMPLAYER, TEAM
    ground_into_double_playsgroundIntoDoublePlayTRUEGround into double playshitting , pitchingPLAYER, TEAMPLAYER, TEAM
    strikesstrikesTRUEStrikespitchingPLAYER, TEAMPLAYER, TEAM , GAME
    pitchespitchesThrownTRUEPitchespitchingPLAYER, TEAMPLAYER, TEAM , GAME
    balksbalksTRUEBalkspitchingPLAYER, TEAMPLAYER, TEAM , GAME
    innings_pitchedinningsPitchedTRUEInnings pitchedpitchingPLAYERPLAYER
    errorserrorsTRUEErrorsfieldingTEAM
    home_team_errorserrorsTRUEHome team errorsfieldingTEAM
    away_team_errorserrorsTRUEAway team errorsfieldingTEAM
    chanceschancesTRUEChancesfieldingTEAM
    put_outsputOutsTRUEPut outsfieldingTEAM
    assistsassistsTRUEAssistsfieldingTEAM
    double_playsdoublePlaysTRUEDouble playsfieldingTEAM
    attendanceattendanceTRUEAttendancegameTEAMGAME
    game_timegameDurationTRUEGame timegameTEAMGAME
    delay_timegameDurationTRUEDelay timegameTEAMGAME
    longestgameDurationTRUELongestgameTEAM
    shortestgameDurationTRUEShortestgameTEAM
    inninginningsTRUEInninggameTEAMGAME
    win_streakwinStreakTRUEWin streakstreakTEAM
    loss_streaklossStreakTRUELoss streakstreakTEAM
  • team_ids: The team_id(s) for which to return information.

  • league_ids: The league_id(s) for which to return information.

  • sport_ids: The sport_id(s) for which to return information.

  • game_type: The game_type for which to return information.

  • stat_group: Stat group for which to return information. Valid values include:

    stat_group
    hitting
    pitching
    fielding
    catching
    running
    game
    team
    streak
  • limit: Number of records as the limit of the return.

Returns

Returns a tibble with the following columns

col_nametypes
total_splitsinteger
seasoninteger
datecharacter
is_homelogical
rankinteger
game_inningsinteger
stat_at_batsinteger
team_idinteger
team_namecharacter
team_linkcharacter
opponent_idinteger
opponent_namecharacter
opponent_linkcharacter
game_pkinteger
game_linkcharacter
game_numberinteger
game_content_linkcharacter
home_team_idinteger
home_team_namecharacter
home_team_linkcharacter
away_team_idinteger
away_team_namecharacter
away_team_linkcharacter
combined_statslogical
group_display_namecharacter
game_type_idcharacter
game_type_descriptioncharacter
sort_stat_namecharacter
sort_stat_lookup_paramcharacter
sort_stat_is_countinglogical
sort_stat_labelcharacter

Examples

try(mlb_high_low_stats(org_type = 'Team', season = 2020, sort_stat = 'atBats'))