                                Package ‘baseballr’
                                             March 21, 2023
Title Acquiring and Analyzing Baseball Data
Version 1.5.0
Description Provides numerous utilities for acquiring and analyzing
      baseball data from online sources such as 'Baseball Reference' <https:
      //www.baseball-reference.com/>,
      'FanGraphs' <https://www.fangraphs.com/>, and the 'MLB Stats' API <https:
      //www.mlb.com/>.
License MIT + file LICENSE
URL https://billpetti.github.io/baseballr/,
      https://github.com/BillPetti/baseballr
BugReports https://github.com/BillPetti/baseballr/issues
Depends R (>= 4.0.0)
Imports cli (>= 3.4.1), data.table (>= 1.14.0), dplyr (>= 1.0.10),
      ggplot2, glue, httr (>= 0.5), janitor, jsonlite, lubridate,
      magrittr, purrr (>= 1.0.0), Rcpp, RcppParallel, rlang (>=
      1.0.4), rvest (>= 1.0.0), stringr (>= 1.3.0), tibble (>= 3.0),
      tidyr (>= 1.0.0)
Suggests crayon (>= 1.3.4), curl, DBI, furrr, future, ggrepel, knitr,
      pacman, progressr (>= 0.6.0), qs (>= 0.25.1), reshape2,
      rmarkdown, RSQLite, scales, stringi, stats, testthat, usethis
      (>= 1.6.0), xml2 (>= 1.3), zoo
VignetteBuilder knitr
Encoding UTF-8
LazyData true
RoxygenNote 7.2.3
NeedsCompilation no
Author Bill Petti [aut],
      Saiem Gilani [aut, cre],
      Ben Baumer [ctb],
      Ben Dilday [ctb],
      Robert Frey [ctb],
      Camden Kay [ctb]
                                                        1
2                                                                                  R topics documented:
Maintainer Saiem Gilani <saiem.gilani@gmail.com>
Repository CRAN
Date/Publication 2023-03-21 17:30:06 UTC
R topics documented:
        batter_game_logs_fg . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
        bref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
        bref_daily_batter . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
        bref_daily_pitcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
        bref_standings_on_date . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
        bref_team_results . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
        chadwick . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
        chadwick_player_lu . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
        code_barrel . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
        column_structure_draft_mlb     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
        daily_batter_bref . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
        daily_pitcher_bref . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
        edge_code . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
        edge_frequency . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
        fangraphs . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
        fg_batter_game_logs . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
        fg_batter_leaders . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
        fg_bat_leaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
        fg_guts . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
        fg_milb_batter_game_logs .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
        fg_milb_pitcher_game_logs      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
        fg_park . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
        fg_pitcher_game_logs . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
        fg_pitcher_leaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
        fg_pitch_leaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
        fg_team_batter . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
        fg_team_pitcher . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
        fip_plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
        get_batting_orders . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
        get_draft_mlb . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
        get_game_info_mlb . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
        get_game_info_sup_petti . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
        get_game_pks_mlb . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
        get_ncaa_baseball_pbp . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
        get_ncaa_game_logs . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
        get_ncaa_lineups . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
        get_ncaa_park_factor . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
        get_ncaa_schedule_info . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
        get_pbp_mlb . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
        get_probables_mlb . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
        get_retrosheet_data . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
R topics documented:                                                                                       3
         get_umpire_ids_petti . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  69
         ggspraychart . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  70
         label_statcast_imputed_data . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  71
         linear_weights_savant . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  74
         load_game_info_sup . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  74
         load_ncaa_baseball_pbp . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  75
         load_ncaa_baseball_schedule . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  76
         load_ncaa_baseball_season_ids .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  77
         load_ncaa_baseball_teams . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  78
         load_umpire_ids . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  78
         metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  79
         milb_batter_game_logs_fg . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  80
         milb_pitcher_game_logs_fg . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  80
         mlb . . . . . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  81
         mlb_all_star_ballots . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  82
         mlb_all_star_final_vote . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  83
         mlb_all_star_write_ins . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  85
         mlb_attendance . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  86
         mlb_award . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  88
         mlb_awards . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  89
         mlb_awards_recipient . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  90
         mlb_baseball_stats . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  91
         mlb_batting_orders . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  92
         mlb_conferences . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  93
         mlb_divisions . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  93
         mlb_draft . . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  94
         mlb_draft_latest . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  96
         mlb_draft_prospects . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  99
         mlb_event_types . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
         mlb_fielder_detail_types . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
         mlb_game_changes . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
         mlb_game_content . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
         mlb_game_context_metrics . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
         mlb_game_info . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
         mlb_game_linescore . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
         mlb_game_pace . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
         mlb_game_pks . . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
         mlb_game_status_codes . . . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
         mlb_game_timecodes . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
         mlb_game_types . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
         mlb_game_wp . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
         mlb_high_low_stats . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
         mlb_high_low_types . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
         mlb_hit_trajectories . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
         mlb_homerun_derby . . . . . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
         mlb_homerun_derby_bracket . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
         mlb_homerun_derby_players . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
         mlb_jobs . . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
4                                                                            R topics documented:
  mlb_jobs_datacasters . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
  mlb_jobs_official_scorers . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
  mlb_jobs_umpires . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
  mlb_job_types . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
  mlb_languages . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
  mlb_league . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
  mlb_league_leader_types . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
  mlb_logical_events . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
  mlb_metrics . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
  mlb_pbp . . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
  mlb_pbp_diff . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
  mlb_people . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
  mlb_people_free_agents . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
  mlb_pitch_codes . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
  mlb_pitch_types . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
  mlb_player_game_stats . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
  mlb_player_game_stats_current      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
  mlb_player_status_codes . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
  mlb_positions . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
  mlb_probables . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
  mlb_review_reasons . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
  mlb_rosters . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
  mlb_roster_types . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
  mlb_runner_detail_types . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
  mlb_schedule . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
  mlb_schedule_event_types . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
  mlb_schedule_games_tied . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
  mlb_schedule_postseason . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
  mlb_schedule_postseason_series     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
  mlb_seasons . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
  mlb_seasons_all . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
  mlb_situation_codes . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
  mlb_sky . . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
  mlb_sports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
  mlb_sports_info . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
  mlb_sports_players . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
  mlb_standings . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
  mlb_standings_types . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
  mlb_stats . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
  mlb_stats_leaders . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
  mlb_stat_groups . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
  mlb_stat_types . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
  mlb_teams . . . . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
  mlb_teams_stats . . . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
  mlb_teams_stats_leaders . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
  mlb_team_affiliates . . . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
  mlb_team_alumni . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
  mlb_team_coaches . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
R topics documented:                                                                                        5
         mlb_team_history . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
         mlb_team_info . . . . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
         mlb_team_leaders . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
         mlb_team_personnel . . . . . . . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
         mlb_team_stats . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
         mlb_venues . . . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
         mlb_wind_direction_codes . . . . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
         most_recent_mlb_season . . . . . .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
         most_recent_ncaa_baseball_season .       . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
         ncaa . . . . . . . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
         ncaa_baseball_roster . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
         ncaa_game_logs . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
         ncaa_lineups . . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
         ncaa_park_factor . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
         ncaa_pbp . . . . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
         ncaa_roster . . . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
         ncaa_schedule_info . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
         ncaa_school_id_lu . . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
         ncaa_scrape . . . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
         ncaa_teams . . . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
         ncaa_team_player_stats . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
         pitcher_game_logs_fg . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
         playerid_lookup . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
         playername_lookup . . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
         process_statcast_payload . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
         retrosheet_data . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
         run_expectancy_code . . . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
         school_id_lu . . . . . . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
         scrape_savant_leaderboards . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
         scrape_statcast_savant . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
         sptrc_league_payrolls . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
         sptrc_team_active_payroll . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
         standings_on_date_bref . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
         statcast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
         statcast_impute . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
         statcast_leaderboards . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
         statcast_search . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
         statline_from_statcast . . . . . . . .   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
         stats_api_live_empty_df . . . . . .      . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
         teams_lu_table . . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
         team_consistency . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
         team_results_bref . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
         woba_plus . . . . . . . . . . . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Index                                                                                                     243
6                                                                                            bref
  batter_game_logs_fg          (legacy) Scrape Batter Game Logs from FanGraphs
Description
    (legacy) Scrape Batter Game Logs from FanGraphs
Usage
    batter_game_logs_fg(playerid, year = 2017)
Arguments
    playerid           This is the playerid used by FanGraphs for a given player
    year               The season for which game logs should be returned (use the YYYY format)
Value
    A data frame of batter game logs.
  bref                         Baseball Reference Functions Overview
Description
    bref_daily_batter() Scrape Batter Performance Data Over a Custom Time Frame
    bref_daily_pitcher() Scrape Pitcher Performance Data Over a Custom Time Frame
    bref_standings_on_date() Scrape MLB Standings on a Given Date
    bref_team_results() Scrape Team Results
Details
      Scrape Batter Performance Data Over a Custom Time Frame:
        bref_daily_batter("2015-05-10", "2015-06-20")
      Scrape Pitcher Performance Data Over a Custom Time Frame:
        bref_daily_batter("2015-05-10", "2015-06-20")
      Scrape MLB Standings on a Given Date:
        bref_standings_on_date(date = "2015-08-04", division = "AL East")
      Scrape Team Results:
bref_daily_batter                                                                                      7
         bref_team_results("NYM", 2015)
         bref_team_results(Tm="TBR", year=2008)
      Team Level Consistency:
      Uses bref_team_results() to calculate team consistency metrics
         team_consistency(year=2015)
  bref_daily_batter             Scrape Batter Performance Data Over a Custom Time Frame
Description
    This function allows you to scrape basic batter statistics over a custom time frame. Data is sourced
    from Baseball-Reference.com.
Usage
    bref_daily_batter(t1, t2)
Arguments
    t1                  First date data should be scraped from. Should take the form "YEAR-MONTH-
                        DAY"
    t2                  Last date data should be scraped from. Should take the form "YEAR-MONTH-
                        DAY"
Value
    Returns a tibble of batter performance with the following columns:
                                          col_name     types
                                           bbref_id    character
                                           season      integer
                                           Name        character
                                           Age         numeric
                                           Level       character
                                           Team        character
                                           G           numeric
                                           PA          numeric
                                           AB          numeric
                                           R           numeric
                                           H           numeric
                                           X1B         numeric
                                           X2B         numeric
                                           X3B         numeric
                                           HR          numeric
                                           RBI         numeric
8                                                                                      bref_daily_pitcher
                                           BB          numeric
                                           IBB         numeric
                                           uBB         numeric
                                           SO          numeric
                                           HBP         numeric
                                           SH          numeric
                                           SF          numeric
                                           GDP         numeric
                                           SB          numeric
                                           CS          numeric
                                           BA          numeric
                                           OBP         numeric
                                           SLG         numeric
                                           OPS         numeric
Examples
      try(bref_daily_batter(t1="2015-05-10", t2="2015-06-20"))
  bref_daily_pitcher            Scrape Pitcher Performance Data Over a Custom Time Frame
Description
    This function allows you to scrape basic pitcher statistics over a custom time frame. Data is sourced
    from Baseball-Reference.com.
Usage
    bref_daily_pitcher(t1, t2)
Arguments
    t1                  First date data should be scraped from. Should take the form "YEAR-MONTH-
                        DAY"
    t2                  Last date data should be scraped from. Should take the form "YEAR-MONTH-
                        DAY"
Value
    Returns a tibble of pitcher performance with the following columns:
                                          col_name     types
                                           bbref_id    character
bref_daily_pitcher                    9
                   season   integer
                   Name     character
                   Age      numeric
                   Level    character
                   Team     character
                   G        numeric
                   GS       numeric
                   W        numeric
                   L        numeric
                   SV       numeric
                   IP       numeric
                   H        numeric
                   R        numeric
                   ER       numeric
                   uBB      numeric
                   BB       numeric
                   SO       numeric
                   HR       numeric
                   HBP      numeric
                   ERA      numeric
                   AB       numeric
                   X1B      numeric
                   X2B      numeric
                   X3B      numeric
                   IBB      numeric
                   GDP      numeric
                   SF       numeric
                   SB       numeric
                   CS       numeric
                   PO       numeric
                   BF       numeric
                   Pit      numeric
                   Str      numeric
                   StL      numeric
                   StS      numeric
                   GB.FB    numeric
                   LD       numeric
                   PU       numeric
                   WHIP     numeric
                   BAbip    numeric
                   SO9      numeric
                   SO.W     numeric
                   SO_perc  numeric
                   uBB_perc numeric
                   SO_uBB   numeric
10                                                                              bref_standings_on_date
Examples
       try(bref_daily_pitcher("2015-05-10", "2015-06-20"))
   bref_standings_on_date
                                Scrape MLB Standings on a Given Date
Description
     This function allows you to scrape the standings from MLB for any date you choose.
Usage
     bref_standings_on_date(date, division, from = FALSE)
Arguments
     date                a date object
     division            One or more of AL East, AL Central, AL West, AL Overall, NL East, NL Cen-
                         tral, NL West, and NL Overall
     from                a logical indicating whether you want standings up to and including the date
                         (FALSE, default) or rather standings for games played after the date
Value
     Returns a tibble of MLB standings with the following columns:
                                         col_name       types
                                          Tm            character
                                          W             integer
                                          L             integer
                                          W-L%          numeric
                                          GB            character
                                          RS            integer
                                          RA            integer
                                          pythW-L%      numeric
Examples
       try(bref_standings_on_date(date = "2015-08-04", division = "AL East"))
bref_team_results                                                                              11
  bref_team_results           Scrape Team Results
Description
    This function allows you to scrape schedule and results for a major league team from Baseball-
    Reference.com
Usage
    bref_team_results(Tm, year)
Arguments
    Tm                  The abbreviation used by Baseball-Reference.com for the team whose results
                        you want to scrape.
    year                Season for which you want to scrape the park factors.
Value
    Returns a tibble of MLB team results and the following columns:
                                     col_name           types
                                      Gm                numeric
                                      Date              character
                                      Tm                character
                                      H_A               character
                                      Opp               character
                                      Result            character
                                      R                 numeric
                                      RA                numeric
                                      Inn               character
                                      Record            character
                                      Rank              numeric
                                      GB                character
                                      Win               character
                                      Loss              character
                                      Save              character
                                      Time              character
                                      D/N               character
                                      Attendance        numeric
                                      cLI               numeric
                                      Streak            numeric
                                      Orig_Scheduled    character
                                      Year              numeric
12                                                                                  chadwick_player_lu
Examples
       try(bref_team_results("NYM", 2015))
       try(bref_team_results(Tm="TBR", year=2008))
   chadwick                    Chadwick Bureau Register Player Lookup
Description
     chadwick_player_lu(): Directly download the Chadwick Bureau’s public register of baseball
          players and the various IDs associated with them in different systems of record.
     playername_lookup(): Look up Baseball Player Name.
     playerid_lookup(): Look up Baseball Player IDs.
Details
       Directly download the Chadwick Bureau’s public register of baseball players.:
         chadwick_player_lu()
       Look up baseball player name by ID:
         playername_lookup(4885)
         playername_lookup("kaaihki01")
       Look up baseball player IDs by player name:
         playerid_lookup("Garcia", "Karim")
   chadwick_player_lu          Download the Chadwick Bureau’s public register of baseball play-
                               ers
Description
     Download the Chadwick Bureau’s public register of baseball players
Usage
     chadwick_player_lu()
     get_chadwick_lu()
Value
     A data frame of baseball players and the various IDs associated with them in different systems of
     record and the following columns:
chadwick_player_lu                                                                                13
                                  col_name               types
                                   key_person            character
                                   key_uuid              character
                                   key_mlbam             integer
                                   key_retro             character
                                   key_bbref             character
                                   key_bbref_minors      character
                                   key_fangraphs         integer
                                   key_npb               integer
                                   key_sr_nfl            character
                                   key_sr_nba            character
                                   key_sr_nhl            character
                                   key_findagrave        integer
                                   name_last             character
                                   name_first            character
                                   name_given            character
                                   name_suffix           character
                                   name_matrilineal      character
                                   name_nick             character
                                   birth_year            integer
                                   birth_month           integer
                                   birth_day             integer
                                   death_year            integer
                                   death_month           integer
                                   death_day             integer
                                   pro_played_first      integer
                                   pro_played_last       integer
                                   mlb_played_first      integer
                                   mlb_played_last       integer
                                   col_played_first      integer
                                   col_played_last       integer
                                   pro_managed_first     integer
                                   pro_managed_last      integer
                                   mlb_managed_first     integer
                                   mlb_managed_last      integer
                                   col_managed_first     integer
                                   col_managed_last      integer
                                   pro_umpired_first     integer
                                   pro_umpired_last      integer
                                   mlb_umpired_first     integer
                                   mlb_umpired_last      integer
    A data frame of baseball players and the various IDs associated with them in different systems of
    record.
Examples
14                                                                          column_structure_draft_mlb
       try(chadwick_player_lu())
   code_barrel                  Helper for determining whether a batted ball is a "barrel"
Description
     This function allows you to code a batted ball as a barrel as defined by the Statcast research team
     using data as provided by baseballsavant.mlb.com.
Usage
     code_barrel(df)
Arguments
     df                  A dataframe generated by baseballsavant.mlb.com that must include the follow-
                         ing variables: launch_angle and launch_speed.
Value
     Returns a tibble with the additional column, barrel.
   column_structure_draft_mlb
                                Column structure of the MLB Draft data
Description
     A tibble giving column structure of MLB Draft data
Usage
     column_structure_draft_mlb
Format
     An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 72 columns.
daily_batter_bref                                                                               15
  daily_batter_bref              (legacy) Scrape Batter Performance Data Over a Custom Time
                                 Frame
Description
     (legacy) Scrape Batter Performance Data Over a Custom Time Frame
Usage
     daily_batter_bref(t1, t2)
Arguments
     t1                  First date data should be scraped from. Should take the form "YEAR-MONTH-
                         DAY"
     t2                  Last date data should be scraped from. Should take the form "YEAR-MONTH-
                         DAY"
Value
     Returns a tibble of batter performance
See Also
     bref_daily_batter()
  daily_pitcher_bref             (legacy) Scrape Pitcher Performance Data Over a Custom Time
                                 Frame
Description
     (legacy) Scrape Pitcher Performance Data Over a Custom Time Frame
Usage
     daily_pitcher_bref(t1, t2)
Arguments
     t1                  First date data should be scraped from. Should take the form "YEAR-MONTH-
                         DAY"
     t2                  Last date data should be scraped from. Should take the form "YEAR-MONTH-
                         DAY"
16                                                                                                edge_code
Value
     Returns a tibble of pitcher performance
See Also
     bref_daily_pitcher()
   edge_code                    Edge Code
Description
     This function allows you to classify individual pitches based on the various categories from the
     Edge% metric. The dataframe passed to the function must include the batter’s handedness, the px
     and pz coordinates from the PITCHf/x system, and the batter’s height.
Usage
     edge_code(df, height_var_name = "b_height")
Arguments
     df                  A dataframe that, at a minimum, includes the following columns: batter height
                         (b_height), the batter’s handedness (stand), vertical location of the pitch (pz),
                         and then horizontal location of the pitch (pz)
     height_var_name
                         The name of the variable in the data set that includes the batter’s height. Defaults
                         to b_height which assumes an height + inch format. If the variable name is
                         "Height" it assumes the variable is already converted to inches (as is the case in
                         some databases)
Value
     Returns a tibble with the additional edge columns necessary for calculations.
edge_frequency                                                                                        17
  edge_frequency               Edge Percentage Frequency
Description
    This function allows you to calculate the percent of pitches thrown to different edges of the strike
    zone for a pitch by pitch data set that has been coded using the edge_code() function.
Usage
    edge_frequency(df, group = NULL)
Arguments
    df                  A data frame of pitch by pitch data that has been coded using the edge_code()
                        function.
    group               Character string indicating what column to group the frequency by. For exam-
                        ple, "pitcher" or "batter". Defaults to NULL, which calculates the frequencies
                        across the entire data set.
Value
    Returns a tibble with the additional edge columns necessary for frequency calculations.
  fangraphs                    FanGraphs Functions Overview
Description
    fg_pitcher_game_logs(): Scrape Pitcher Game Logs from FanGraphs.
    fg_batter_game_logs(): Scrape Batter Game Logs from FanGraphs.
    fg_milb_pitcher_game_logs(): Scrape MiLB game logs for pitchers from Fangraphs, combin-
         ing ’standard’ and ’advanced’ tabs.
    fg_milb_batter_game_logs(): Scrape MiLB game logs for batters from Fangraphs, combining
         ’standard’ and ’advanced’ tabs.
    fg_batter_leaders(): Scrape Batter Leaderboards from FanGraphs.
    fg_pitcher_leaders(): Scrape Pitcher Leaderboards from FanGraphs.
    fg_guts(): Scrape FanGraphs.com Guts!.
    fg_park(): Scrape Park Factors from FanGraphs.com.
    fg_park_hand(): Scrape Park Factors by handedness from FanGraphs.com.
18                                                                                fg_batter_game_logs
Details
      Scrape Pitcher Game Logs from FanGraphs:
         fg_pitcher_game_logs(playerid = 104, year = 2006)
      Scrape Batter Game Logs from FanGraphs:
         fg_batter_game_logs(playerid = 6184, year = 2017)
      Scrape MiLB game logs for pitchers from Fangraphs:
         fg_milb_pitcher_game_logs(playerid = "sa3004210", year=2017)
      Scrape MiLB game logs for batters from Fangraphs:
         fg_milb_batter_game_logs(playerid = "sa917940", year=2018)
      Scrape Batter Leaderboards from FanGraphs:
         fg_batter_leaders(x = 2015, y = 2015, qual = 400)
      Scrape Pitcher Leaderboards from FanGraphs:
         fg_pitcher_leaders(x = 2015, y = 2015, qual = 150)
      Scrape FanGraphs.com Guts!:
         fg_guts()
      Scrape Park Factors from FanGraphs.com:
         fg_park(2013)
      Scrape Park Factors by handedness from FanGraphs.com:
         fg_park_hand(2013)
   fg_batter_game_logs          Scrape Batter Game Logs from FanGraphs
Description
     This function allows you to scrape game logs by year for a batter from FanGraphs.com.
Usage
     fg_batter_game_logs(playerid, year = 2017)
Arguments
     playerid           This is the playerid used by FanGraphs for a given player
     year               The season for which game logs should be returned (use the YYYY format)
fg_batter_game_logs                                                                                         19
Value
    A data frame of batter game logs. |col_name |types | |:————-|:———| |PlayerName |charac-
    ter | |playerid |integer | |Date |character | |Team |character | |Opp |character | |season |integer | |Age
    |integer | |BatOrder |character | |Pos |character | |G |numeric | |AB |numeric | |PA |numeric | |H |nu-
    meric | |1B |numeric | |2B |numeric | |3B |numeric | |HR |numeric | |R |numeric | |RBI |numeric |
    |BB |numeric | |IBB |numeric | |SO |numeric | |HBP |numeric | |SF |numeric | |SH |numeric | |GDP
    |numeric | |SB |numeric | |CS |numeric | |AVG |numeric | |GB |numeric | |FB |numeric | |LD |numeric
    | |IFFB |numeric | |Pitches |numeric | |Balls |numeric | |Strikes |numeric | |IFH |numeric | |BU |nu-
    meric | |BUH |numeric | |BB% |numeric | |K% |numeric | |BB/K |numeric | |OBP |numeric | |SLG
    |numeric | |OPS |numeric | |ISO |numeric | |BABIP |numeric | |GB/FB |numeric | |LD% |numeric |
    |GB% |numeric | |FB% |numeric | |IFFB% |numeric | |HR/FB |numeric | |IFH% |numeric | |BUH%
    |numeric | |wOBA |numeric | |wRAA |numeric | |wRC |numeric | |Spd |numeric | |wRC+ |numeric |
    |wBSR |numeric | |WPA |numeric | |-WPA |numeric | |+WPA |numeric | |RE24 |numeric | |REW |nu-
    meric | |pLI |numeric | |phLI |numeric | |PH |numeric | |WPA/LI |numeric | |Clutch |numeric | |FB%1
    |numeric | |FBv |numeric | |SL% |numeric | |SLv |numeric | |CT% |numeric | |CTv |numeric | |CB%
    |numeric | |CBv |numeric | |CH% |numeric | |CHv |numeric | |SF% |numeric | |SFv |numeric | |KN%
    |numeric | |KNv |numeric | |XX% |numeric | |wFB |numeric | |wSL |numeric | |wCT |numeric | |wCB
    |numeric | |wCH |numeric | |wSF |numeric | |wKN |numeric | |wFB/C |numeric | |wSL/C |numeric |
    |wCT/C |numeric | |wCB/C |numeric | |wCH/C |numeric | |wSF/C |numeric | |wKN/C |numeric | |O-
    Swing% |numeric | |Z-Swing% |numeric | |Swing% |numeric | |O-Contact% |numeric | |Z-Contact%
    |numeric | |Contact% |numeric | |Zone% |numeric | |F-Strike% |numeric | |SwStr% |numeric | |Pull
    |numeric | |Cent |numeric | |Oppo |numeric | |Soft |numeric | |Med |numeric | |Hard |numeric | |bip-
    Count |numeric | |Pull% |numeric | |Cent% |numeric | |Oppo% |numeric | |Soft% |numeric | |Med%
    |numeric | |Hard% |numeric | |pfxFA% |numeric | |pfxFT% |numeric | |pfxFC% |numeric | |pfxFS%
    |numeric | |pfxFO% |numeric | |pfxSI% |numeric | |pfxSL% |numeric | |pfxCU% |numeric | |pfxKC%
    |numeric | |pfxCH% |numeric | |pfxKN% |numeric | |pfxvFA |numeric | |pfxvFT |numeric | |pfxvFC
    |numeric | |pfxvFS |numeric | |pfxvFO |numeric | |pfxvSI |numeric | |pfxvSL |numeric | |pfxvCU |nu-
    meric | |pfxvKC |numeric | |pfxvCH |numeric | |pfxvKN |numeric | |pfxFA-X |numeric | |pfxFT-X
    |numeric | |pfxFC-X |numeric | |pfxFS-X |numeric | |pfxFO-X |numeric | |pfxSI-X |numeric | |pfxSL-
    X |numeric | |pfxCU-X |numeric | |pfxKC-X |numeric | |pfxCH-X |numeric | |pfxKN-X |numeric |
    |pfxFA-Z |numeric | |pfxFT-Z |numeric | |pfxFC-Z |numeric | |pfxFS-Z |numeric | |pfxFO-Z |numeric
    | |pfxSI-Z |numeric | |pfxSL-Z |numeric | |pfxCU-Z |numeric | |pfxKC-Z |numeric | |pfxCH-Z |nu-
    meric | |pfxKN-Z |numeric | |pfxwFA |numeric | |pfxwFT |numeric | |pfxwFC |numeric | |pfxwFS
    |numeric | |pfxwFO |numeric | |pfxwSI |numeric | |pfxwSL |numeric | |pfxwCU |numeric | |pfxwKC
    |numeric | |pfxwCH |numeric | |pfxwKN |numeric | |pfxwFA/C |numeric | |pfxwFT/C |numeric |
    |pfxwFC/C |numeric | |pfxwFS/C |numeric | |pfxwFO/C |numeric | |pfxwSI/C |numeric | |pfxwSL/C
    |numeric | |pfxwCU/C |numeric | |pfxwKC/C |numeric | |pfxwCH/C |numeric | |pfxwKN/C |numeric
    | |pfxO-Swing% |numeric | |pfxZ-Swing% |numeric | |pfxSwing% |numeric | |pfxO-Contact% |nu-
    meric | |pfxZ-Contact% |numeric | |pfxContact% |numeric | |pfxZone% |numeric | |pfxPace |numeric
    | |piCH% |numeric | |piCS% |numeric | |piCU% |numeric | |piFA% |numeric | |piFC% |numeric |
    |piFS% |numeric | |piKN% |numeric | |piSI% |numeric | |piSL% |numeric | |piXX% |numeric | |pivCH
    |numeric | |pivCS |numeric | |pivCU |numeric | |pivFA |numeric | |pivFC |numeric | |pivFS |numeric |
    |pivKN |numeric | |pivSI |numeric | |pivSL |numeric | |pivXX |numeric | |piCH-X |numeric | |piCS-X
    |numeric | |piCU-X |numeric | |piFA-X |numeric | |piFC-X |numeric | |piFS-X |numeric | |piKN-X
    |numeric | |piSI-X |numeric | |piSL-X |numeric | |piXX-X |numeric | |piCH-Z |numeric | |piCS-Z
    |numeric | |piCU-Z |numeric | |piFA-Z |numeric | |piFC-Z |numeric | |piFS-Z |numeric | |piKN-Z |nu-
    meric | |piSI-Z |numeric | |piSL-Z |numeric | |piXX-Z |numeric | |piwCH |numeric | |piwCS |numeric
    | |piwCU |numeric | |piwFA |numeric | |piwFC |numeric | |piwFS |numeric | |piwKN |numeric | |piwSI
20                                                                                        fg_batter_leaders
     |numeric | |piwSL |numeric | |piwXX |numeric | |piwCH/C |numeric | |piwCS/C |numeric | |piwCU/C
     |numeric | |piwFA/C |numeric | |piwFC/C |numeric | |piwFS/C |numeric | |piwKN/C |numeric | |pi-
     wSI/C |numeric | |piwSL/C |numeric | |piwXX/C |numeric | |piO-Swing% |numeric | |piZ-Swing%
     |numeric | |piSwing% |numeric | |piO-Contact% |numeric | |piZ-Contact% |numeric | |piContact%
     |numeric | |piZone% |numeric | |Events |numeric | |EV |numeric | |LA |numeric | |Barrels |numeric |
     |Barrel% |numeric | |maxEV |numeric | |HardHit |numeric | |HardHit% |numeric | |gamedate |charac-
     ter | |dh |integer |
Examples
        try(fg_batter_game_logs(playerid = 6184, year = 2017))
   fg_batter_leaders              Scrape Batter Leaderboards from FanGraphs
Description
     This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.
Usage
     fg_batter_leaders(x, y, league = "all", qual = "y", ind = 1, exc_p = TRUE)
Arguments
     x                    First season for which you want data.
     y                    Last season for which you want data. If multiple years selected, data returned
                          will be aggregate data for the date range. If y = x, function will return single-
                          season data.
     league               Option for limiting results to different leagues or overall results. Options are
                          "al", "nl", or "all".
     qual                 Whether you want only batters/pitchers that qualified in a given season, or the
                          minimum number of plate appearances for inclusion. If you only want qualified
                          hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                          the number desired. Defaults to "y".
     ind                  Whether or not to break the seasons out individual, or roll them up together. 1 =
                          split seasons, 0 = aggregate seasons.
     exc_p                (logical) Whether or not to exclude pitchers from the batter leaderboards. TRUE
                          = exclude pitchers, FALSE = retain pitchers.
fg_batter_leaders                                    21
Value
    A data frame of batter data.
                                 col_name  types
                                  playerid character
                                  #        character
                                  Season   character
                                  Name     character
                                  Team     character
                                  Age      numeric
                                  G        numeric
                                  AB       numeric
                                  PA       numeric
                                  H        numeric
                                  1B       numeric
                                  2B       numeric
                                  3B       numeric
                                  HR       numeric
                                  R        numeric
                                  RBI      numeric
                                  BB       numeric
                                  IBB      numeric
                                  SO       numeric
                                  HBP      numeric
                                  SF       numeric
                                  SH       numeric
                                  GDP      numeric
                                  SB       numeric
                                  CS       numeric
                                  AVG      numeric
                                  GB       numeric
                                  FB       numeric
                                  LD       numeric
                                  IFFB     numeric
                                  Pitches  numeric
                                  Balls    numeric
                                  Strikes  numeric
                                  IFH      numeric
                                  BU       numeric
                                  BUH      numeric
                                  BB_pct   numeric
                                  K_pct    numeric
                                  BB_K     numeric
                                  OBP      numeric
                                  SLG      numeric
                                  OPS      numeric
                                  ISO      numeric
                                  BABIP    numeric
22                   fg_batter_leaders
   GB_FB     numeric
   LD_pct    numeric
   GB_pct    numeric
   FB_pct    numeric
   IFFB_pct  numeric
   HR_FB     numeric
   IFH_pct   numeric
   BUH_pct   numeric
   wOBA      numeric
   wRAA      numeric
   wRC       numeric
   Bat       numeric
   Fld       numeric
   Rep       numeric
   Pos       numeric
   RAR       numeric
   WAR       numeric
   Dol       numeric
   Spd       numeric
   wRC_plus  numeric
   WPA       numeric
   WPA_minus numeric
   WPA_plus  numeric
   RE24      numeric
   REW       numeric
   pLI       numeric
   phLI      numeric
   PH        numeric
   WPA_LI    numeric
   Clutch    numeric
   FBall_pct numeric
   FBv       numeric
   SL_pct    numeric
   SLv       numeric
   CT_pct    numeric
   CTv       numeric
   CB_pct    numeric
   CBv       numeric
   CH_pct    numeric
   CHv       numeric
   SF_pct    numeric
   SFv       numeric
   KN_pct    numeric
   KNv       numeric
   XX_pct    numeric
   PO_pct    numeric
   wFB       numeric
   wSL       numeric
fg_batter_leaders                       23
                  wCT           numeric
                  wCB           numeric
                  wCH           numeric
                  wSF           numeric
                  wKN           numeric
                  wFB_C         numeric
                  wSL_C         numeric
                  wCT_C         numeric
                  wCB_C         numeric
                  wCH_C         numeric
                  wSF_C         numeric
                  wKN_C         numeric
                  O-Swing_pct   numeric
                  Z-Swing_pct   numeric
                  Swing_pct     numeric
                  O-Contact_pct numeric
                  Z-Contact_pct numeric
                  Contact_pct   numeric
                  Zone_pct      numeric
                  F-Strike_pct  numeric
                  SwStr_pct     numeric
                  BsR           numeric
                  FA_pct (sc)   numeric
                  FT_pct (sc)   numeric
                  FC_pct (sc)   numeric
                  FS_pct (sc)   numeric
                  FO_pct (sc)   numeric
                  SI_pct (sc)   numeric
                  SL_pct (sc)   numeric
                  CU_pct (sc)   numeric
                  KC_pct (sc)   numeric
                  EP_pct (sc)   numeric
                  CH_pct (sc)   numeric
                  SC_pct (sc)   numeric
                  KN_pct (sc)   numeric
                  UN_pct (sc)   numeric
                  vFA (sc)      numeric
                  vFT (sc)      numeric
                  vFC (sc)      numeric
                  vFS (sc)      numeric
                  vFO (sc)      numeric
                  vSI (sc)      numeric
                  vSL (sc)      numeric
                  vCU (sc)      numeric
                  vKC (sc)      numeric
                  vEP (sc)      numeric
                  vCH (sc)      numeric
                  vSC (sc)      numeric
24                    fg_batter_leaders
   vKN (sc)   numeric
   FA-X (sc)  numeric
   FT-X (sc)  numeric
   FC-X (sc)  numeric
   FS-X (sc)  numeric
   FO-X (sc)  numeric
   SI-X (sc)  numeric
   SL-X (sc)  numeric
   CU-X (sc)  numeric
   KC-X (sc)  numeric
   EP-X (sc)  numeric
   CH-X (sc)  numeric
   SC-X (sc)  numeric
   KN-X (sc)  numeric
   FA-Z (sc)  numeric
   FT-Z (sc)  numeric
   FC-Z (sc)  numeric
   FS-Z (sc)  numeric
   FO-Z (sc)  numeric
   SI-Z (sc)  numeric
   SL-Z (sc)  numeric
   CU-Z (sc)  numeric
   KC-Z (sc)  numeric
   EP-Z (sc)  numeric
   CH-Z (sc)  numeric
   SC-Z (sc)  numeric
   KN-Z (sc)  numeric
   wFA (sc)   numeric
   wFT (sc)   numeric
   wFC (sc)   numeric
   wFS (sc)   numeric
   wFO (sc)   numeric
   wSI (sc)   numeric
   wSL (sc)   numeric
   wCU (sc)   numeric
   wKC (sc)   numeric
   wEP (sc)   numeric
   wCH (sc)   numeric
   wSC (sc)   numeric
   wKN (sc)   numeric
   wFA_C (sc) numeric
   wFT_C (sc) numeric
   wFC_C (sc) numeric
   wFS_C (sc) numeric
   wFO_C (sc) numeric
   wSI_C (sc) numeric
   wSL_C (sc) numeric
   wCU_C (sc) numeric
fg_batter_leaders                            25
                  wKC_C (sc)         numeric
                  wEP_C (sc)         numeric
                  wCH_C (sc)         numeric
                  wSC_C (sc)         numeric
                  wKN_C (sc)         numeric
                  O-Swing_pct (sc)   numeric
                  Z-Swing_pct (sc)   numeric
                  Swing_pct (sc)     numeric
                  O-Contact_pct (sc) numeric
                  Z-Contact_pct (sc) numeric
                  Contact_pct (sc)   numeric
                  Zone_pct (sc)      numeric
                  Pace               numeric
                  Def                numeric
                  wSB                numeric
                  UBR                numeric
                  AgeRng             numeric
                  Off                numeric
                  Lg                 numeric
                  wGDP               numeric
                  Pull_pct           numeric
                  Cent_pct           numeric
                  Oppo_pct           numeric
                  Soft_pct           numeric
                  Med_pct            numeric
                  Hard_pct           numeric
                  TTO_pct            numeric
                  CH_pct_pi          numeric
                  CS_pct_pi          numeric
                  CU_pct_pi          numeric
                  FA_pct_pi          numeric
                  FC_pct_pi          numeric
                  FS_pct_pi          numeric
                  KN_pct_pi          numeric
                  SB_pct_pi          numeric
                  SI_pct_pi          numeric
                  SL_pct_pi          numeric
                  XX_pct_pi          numeric
                  vCH_pi             numeric
                  vCS_pi             numeric
                  vCU_pi             numeric
                  vFA_pi             numeric
                  vFC_pi             numeric
                  vFS_pi             numeric
                  vKN_pi             numeric
                  vSB_pi             numeric
                  vSI_pi             numeric
                  vSL_pi             numeric
26                        fg_batter_leaders
   vXX_pi         numeric
   CH-X_pi        numeric
   CS-X_pi        numeric
   CU-X_pi        numeric
   FA-X_pi        numeric
   FC-X_pi        numeric
   FS-X_pi        numeric
   KN-X_pi        numeric
   SB-X_pi        numeric
   SI-X_pi        numeric
   SL-X_pi        numeric
   XX-X_pi        numeric
   CH-Z_pi        numeric
   CS-Z_pi        numeric
   CU-Z_pi        numeric
   FA-Z_pi        numeric
   FC-Z_pi        numeric
   FS-Z_pi        numeric
   KN-Z_pi        numeric
   SB-Z_pi        numeric
   SI-Z_pi        numeric
   SL-Z_pi        numeric
   XX-Z_pi        numeric
   wCH_pi         numeric
   wCS_pi         numeric
   wCU_pi         numeric
   wFA_pi         numeric
   wFC_pi         numeric
   wFS_pi         numeric
   wKN_pi         numeric
   wSB_pi         numeric
   wSI_pi         numeric
   wSL_pi         numeric
   wXX_pi         numeric
   wCH_C_pi       numeric
   wCS_C_pi       numeric
   wCU_C_pi       numeric
   wFA_C_pi       numeric
   wFC_C_pi       numeric
   wFS_C_pi       numeric
   wKN_C_pi       numeric
   wSB_C_pi       numeric
   wSI_C_pi       numeric
   wSL_C_pi       numeric
   wXX_C_pi       numeric
   O-Swing_pct_pi numeric
   Z-Swing_pct_pi numeric
   Swing_pct_pi   numeric
fg_bat_leaders                                                                                        27
                                     O-Contact_pct_pi     numeric
                                     Z-Contact_pct_pi     numeric
                                     Contact_pct_pi       numeric
                                     Zone_pct_pi          numeric
                                     Pace_pi              numeric
Examples
       try(fg_batter_leaders(x = 2015, y = 2015, qual = 200))
  fg_bat_leaders               (legacy) Scrape Batter Leaderboards from FanGraphs
Description
    (legacy) Scrape Batter Leaderboards from FanGraphs
Usage
    fg_bat_leaders(x, y, league = "all", qual = "y", ind = 1, exc_p = TRUE)
Arguments
    x                  First season for which you want data.
    y                  Last season for which you want data. If multiple years selected, data returned
                       will be aggregate data for the date range. If y = x, function will return single-
                       season data.
    league             Option for limiting results to different leagues or overall results. Options are
                       "al", "nl", or "all".
    qual               Whether you want only batters/pitchers that qualified in a given season, or the
                       minimum number of plate appearances for inclusion. If you only want qualified
                       hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                       the number desired. Defaults to "y".
    ind                Whether or not to break the seasons out individual, or roll them up together. 1 =
                       split seasons, 0 = aggregate seasons.
    exc_p              (logical) Whether or not to exclude pitchers from the batter leaderboards. TRUE
                       = exclude pitchers, FALSE = retain pitchers.
Value
    A data frame of batter data.
28                                                                         fg_milb_batter_game_logs
   fg_guts                      Scrape FanGraphs.com Guts!
Description
     Scrape historical FanGraphs Guts! table, wOBA, FIP coefficients and constants
Usage
     fg_guts()
Value
     Returns a tibble of seasonal constants from FanGraphs
                                         col_name      types
                                          season       integer
                                          lg_woba      numeric
                                          woba_scale   numeric
                                          wBB          numeric
                                          wHBP         numeric
                                          w1B          numeric
                                          w2B          numeric
                                          w3B          numeric
                                          wHR          numeric
                                          runSB        numeric
                                          runCS        numeric
                                          lg_r_pa      numeric
                                          lg_r_w       numeric
                                          cFIP         numeric
Examples
       try(fg_guts())
   fg_milb_batter_game_logs
                                Scrape MiLB game logs for batters from FanGraphs
Description
     This function allows you to scrape MiLB game logs for individual batters from FanGraphs.
fg_milb_batter_game_logs                                                          29
Usage
    fg_milb_batter_game_logs(playerid, year)
Arguments
    playerid            The batter’s minor league ID from FanGraphs.
    year                The season for which game logs should be returned.
Value
    Returns a tibble of Minor League batter game logs with the following columns:
                                      col_name          types
                                       player_name      character
                                       minor_playerid   character
                                       Date             character
                                       Team             character
                                       Level            character
                                       Opp              character
                                       G                numeric
                                       AB               numeric
                                       PA               numeric
                                       H                numeric
                                       1B               numeric
                                       2B               numeric
                                       3B               numeric
                                       HR               numeric
                                       R                numeric
                                       RBI              numeric
                                       BB               numeric
                                       IBB              numeric
                                       SO               numeric
                                       HBP              numeric
                                       SF               numeric
                                       SH               numeric
                                       GDP              numeric
                                       SB               numeric
                                       CS               numeric
                                       AVG              numeric
                                       BB%              numeric
                                       K%               numeric
                                       BB/K             numeric
                                       OBP              numeric
                                       SLG              numeric
                                       OPS              numeric
                                       ISO              numeric
                                       Spd              numeric
                                       BABIP            numeric
30                                                                        fg_milb_pitcher_game_logs
                                      wRC               numeric
                                      wRAA              numeric
                                      wOBA              numeric
                                      wRC+              numeric
                                      wBsR              numeric
                                      gamedate          character
                                      dh                integer
                                      UPId              character
                                      MLBAMId           character
                                      MinorMasterId     character
                                      RRId              character
                                      FirstName         character
                                      LastName          character
                                      firstLastName     character
                                      Height            character
                                      Weight            character
                                      BirthDate         character
                                      Bats              character
                                      Throws            character
                                      Position          character
                                      BirthCity         character
                                      College           character
                                      Age               character
Examples
       try(fg_milb_batter_game_logs(playerid = "sa3010868", year=2021))
   fg_milb_pitcher_game_logs
                               Scrape MiLB game logs for pitchers from FanGraphs
Description
     This function allows you to scrape MiLB game logs for individual batters from FanGraphs.com.
Usage
     fg_milb_pitcher_game_logs(playerid, year)
Arguments
     playerid           The pitcher’s minor league ID from FanGraphs.com.
     year               The season for which game logs should be returned.
fg_milb_pitcher_game_logs                                       31
Value
    Returns a tibble of Minor League pitcher game logs.
                                    col_name          types
                                     player_name      character
                                     minor_playerid   character
                                     Date             character
                                     Team             character
                                     Level            character
                                     Opp              character
                                     W                numeric
                                     L                numeric
                                     ERA              numeric
                                     G                numeric
                                     GS               numeric
                                     CG               numeric
                                     ShO              numeric
                                     SV               numeric
                                     IP               numeric
                                     TBF              numeric
                                     H                numeric
                                     R                numeric
                                     ER               numeric
                                     HR               numeric
                                     BB               numeric
                                     IBB              numeric
                                     HBP              numeric
                                     WP               numeric
                                     BK               numeric
                                     SO               numeric
                                     K/9              numeric
                                     BB/9             numeric
                                     K/BB             numeric
                                     HR/9             numeric
                                     K%               numeric
                                     K-BB%            numeric
                                     BB%              numeric
                                     AVG              numeric
                                     WHIP             numeric
                                     BABIP            numeric
                                     LOB%             numeric
                                     FIP              numeric
                                     gamedate         character
                                     dh               integer
                                     UPId             character
                                     MLBAMId          character
                                     MinorMasterId    character
                                     RRId             character
32                                                                                          fg_park
                                       FirstName          character
                                       LastName           character
                                       firstLastName      character
                                       Height             character
                                       Weight             character
                                       BirthDate          character
                                       Bats               character
                                       Throws             character
                                       Position           character
                                       BirthCity          character
                                       College            character
                                       Age                character
Examples
       fg_milb_pitcher_game_logs(playerid = "sa3005315", year=2021)
   fg_park                      Scrape Park Factors from FanGraphs
Description
     This function allows you to scrape park factors for a given season from FanGraphs.com.
     This function allows you to scrape park factors by handedness from FanGraphs.com for a given
     single year.
Usage
     fg_park(yr)
     fg_park_hand(yr)
Arguments
     yr                  Season for which you want to scrape the park factors.
Value
     Returns a tibble of park factors.
                                         col_name       types
                                          season        integer
                                          home_team     character
                                          basic_5yr     integer
fg_pitcher_game_logs                                                                       33
                                          3yr        integer
                                          1yr        integer
                                          single     integer
                                          double     integer
                                          triple     integer
                                          hr         integer
                                          so         integer
                                          UIBB       integer
                                          GB         integer
                                          FB         integer
                                          LD         integer
                                          IFFB       integer
                                          FIP        integer
    Returns a tibble of park factors by handedness.
                                      col_name          types
                                       season           integer
                                       home_team        character
                                       single_as_LHH    integer
                                       single_as_RHH    integer
                                       double_as_LHH    integer
                                       double_as_RHH    integer
                                       triple_as_LHH    integer
                                       triple_as_RHH    integer
                                       hr_as_LHH        integer
                                       hr_as_RHH        integer
Examples
       try(fg_park(2013))
       try(fg_park_hand(2013))
  fg_pitcher_game_logs         Scrape Pitcher Game Logs from FanGraphs
Description
    This function allows you to scrape game logs by year for a pitcher from FanGraphs.com.
34                                                                               fg_pitcher_game_logs
Usage
    fg_pitcher_game_logs(playerid, year = 2017)
Arguments
    playerid            This is the playerid used by FanGraphs for a given player
    year                The season for which game logs should be returned (use the YYYY format)
Value
    Returns a tibble of pitcher game logs with the following columns:
                                        col_name        types
                                         PlayerName     character
                                         playerid       integer
                                         Date           character
                                         Opp            character
                                         teamid         integer
                                         season         integer
                                         Team           character
                                         HomeAway       character
                                         Age            integer
                                         W              numeric
                                         L              numeric
                                         ERA            numeric
                                         G              numeric
                                         GS             numeric
                                         CG             numeric
                                         ShO            numeric
                                         SV             numeric
                                         HLD            numeric
                                         BS             numeric
                                         IP             numeric
                                         TBF            numeric
                                         H              numeric
                                         R              numeric
                                         ER             numeric
                                         HR             numeric
                                         BB             numeric
                                         IBB            numeric
                                         HBP            numeric
                                         WP             numeric
                                         BK             numeric
                                         SO             numeric
                                         K/9            numeric
                                         BB/9           numeric
                                         H/9            numeric
                                         K/BB           numeric
fg_pitcher_game_logs                 35
                     IFH%    numeric
                     BUH%    numeric
                     GB      numeric
                     FB      numeric
                     LD      numeric
                     IFFB    numeric
                     IFH     numeric
                     BU      numeric
                     BUH     numeric
                     K%      numeric
                     BB%     numeric
                     K-BB%   numeric
                     SIERA   numeric
                     HR/9    numeric
                     AVG     numeric
                     WHIP    numeric
                     BABIP   numeric
                     LOB%    numeric
                     FIP     numeric
                     E-F     numeric
                     xFIP    numeric
                     ERA-    numeric
                     FIP-    numeric
                     xFIP-   numeric
                     GB/FB   numeric
                     LD%     numeric
                     GB%     numeric
                     FB%     numeric
                     IFFB%   numeric
                     HR/FB   numeric
                     RS      numeric
                     RS/9    numeric
                     Balls   numeric
                     Strikes numeric
                     Pitches numeric
                     WPA     numeric
                     -WPA    numeric
                     +WPA    numeric
                     RE24    numeric
                     REW     numeric
                     pLI     numeric
                     inLI    numeric
                     gmLI    numeric
                     exLI    numeric
                     Pulls   numeric
                     Games   numeric
                     WPA/LI  numeric
                     Clutch  numeric
36                    fg_pitcher_game_logs
   SD         numeric
   MD         numeric
   FB%1       numeric
   FBv        numeric
   SL%        numeric
   SLv        numeric
   CT%        numeric
   CTv        numeric
   CB%        numeric
   CBv        numeric
   CH%        numeric
   CHv        numeric
   XX%        numeric
   PO%        numeric
   wFB        numeric
   wSL        numeric
   wCT        numeric
   wCB        numeric
   wCH        numeric
   wFB/C      numeric
   wSL/C      numeric
   wCT/C      numeric
   wCB/C      numeric
   wCH/C      numeric
   O-Swing%   numeric
   Z-Swing%   numeric
   Swing%     numeric
   O-Contact% numeric
   Z-Contact% numeric
   Contact%   numeric
   Zone%      numeric
   F-Strike%  numeric
   SwStr%     numeric
   Pull       numeric
   Cent       numeric
   Oppo       numeric
   Soft       numeric
   Med        numeric
   Hard       numeric
   bipCount   numeric
   Pull%      numeric
   Cent%      numeric
   Oppo%      numeric
   Soft%      numeric
   Med%       numeric
   Hard%      numeric
   tERA       numeric
   GSv2       numeric
fg_pitcher_leaders                                                                                   37
                                        Events          numeric
                                        gamedate        character
                                        dh              integer
Examples
       try(fg_pitcher_game_logs(playerid = 104, year = 2006))
  fg_pitcher_leaders          Scrape Pitcher Leaderboards from FanGraphs
Description
    Scrape Pitcher Leaderboards from FanGraphs
Usage
    fg_pitcher_leaders(
       x,
       y,
       league = "all",
       qual = "y",
       pitcher_type = "pit",
       ind = 1
    )
Arguments
    x                 First season for which you want data.
    y                 Last season for which you want data. If multiple years selected, data returned
                      will be aggregate data for the date range. If y = x, function will return single-
                      season data.
    league            Option for limiting results to different leagues or overall results. Options are
                      "al", "nl", or "all".
    qual              Whether you want only batters/pitchers that qualified in a given season, or the
                      minimum number of plate appearances for inclusion. If you only want qualified
                      hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                      the number desired. Defaults to "y".
    pitcher_type      Whether you want only starting pitchers, relievers, or all pitchers that meet the
                      criteria specified in the qual argument. Options include "pit", "sta", "rel".
    ind               Whether or not to break the seasons out individual, or roll them up together. 1 =
                      split seasons, 0 = aggregate seasons.
38                                fg_pitcher_leaders
Value
    A data frame of pitcher data.
fg_pitcher_leaders                     39
                   col_name  types
                    playerid character
                    #        character
                    Season   character
                    Name     character
                    Team     character
                    Age      numeric
                    W        numeric
                    L        numeric
                    ERA      numeric
                    G        numeric
                    GS       numeric
                    CG       numeric
                    ShO      numeric
                    SV       numeric
                    BS       numeric
                    IP       numeric
                    TBF      numeric
                    H        numeric
                    R        numeric
                    ER       numeric
                    HR       numeric
                    BB       numeric
                    IBB      numeric
                    HBP      numeric
                    WP       numeric
                    BK       numeric
                    SO       numeric
                    GB       numeric
                    FB       numeric
                    LD       numeric
                    IFFB     numeric
                    Balls    numeric
                    Strikes  numeric
                    Pitches  numeric
                    RS       numeric
                    IFH      numeric
                    BU       numeric
                    BUH      numeric
                    K_9      numeric
                    BB_9     numeric
                    K_BB     numeric
                    H_9      numeric
                    HR_9     numeric
                    AVG      numeric
                    WHIP     numeric
                    BABIP    numeric
                    LOB_pct  numeric
40                   fg_pitcher_leaders
   FIP       numeric
   GB_FB     numeric
   LD_pct    numeric
   GB_pct    numeric
   FB_pct    numeric
   IFFB_pct  numeric
   HR_FB     numeric
   IFH_pct   numeric
   BUH_pct   numeric
   Starting  numeric
   Start_IP  numeric
   Relieving numeric
   Relief_IP numeric
   RAR       numeric
   WAR       numeric
   Dollars   numeric
   tERA      numeric
   xFIP      numeric
   WPA       numeric
   WPA_minus numeric
   WPA_plus  numeric
   RE24      numeric
   REW       numeric
   pLI       numeric
   inLI      numeric
   gmLI      numeric
   exLI      numeric
   Pulls     numeric
   WPA_LI    numeric
   Clutch    numeric
   FBall_pct numeric
   FBv       numeric
   SL_pct    numeric
   SLv       numeric
   CT_pct    numeric
   CTv       numeric
   CB_pct    numeric
   CBv       numeric
   CH_pct    numeric
   CHv       numeric
   SF_pct    numeric
   SFv       numeric
   KN_pct    numeric
   KNv       numeric
   XX_pct    numeric
   PO_pct    numeric
   wFB       numeric
   wSL       numeric
fg_pitcher_leaders                       41
                   wCT           numeric
                   wCB           numeric
                   wCH           numeric
                   wSF           numeric
                   wKN           numeric
                   wFB_C         numeric
                   wSL_C         numeric
                   wCT_C         numeric
                   wCB_C         numeric
                   wCH_C         numeric
                   wSF_C         numeric
                   wKN_C         numeric
                   O-Swing_pct   numeric
                   Z-Swing_pct   numeric
                   Swing_pct     numeric
                   O-Contact_pct numeric
                   Z-Contact_pct numeric
                   Contact_pct   numeric
                   Zone_pct      numeric
                   F-Strike_pct  numeric
                   SwStr_pct     numeric
                   HLD           numeric
                   SD            numeric
                   MD            numeric
                   ERA-          numeric
                   FIP-          numeric
                   xFIP-         numeric
                   K_pct         numeric
                   BB_pct        numeric
                   SIERA         numeric
                   RS_9          numeric
                   E-F           numeric
                   FA_pct (sc)   numeric
                   FT_pct (sc)   numeric
                   FC_pct (sc)   numeric
                   FS_pct (sc)   numeric
                   FO_pct (sc)   numeric
                   SI_pct (sc)   numeric
                   SL_pct (sc)   numeric
                   CU_pct (sc)   numeric
                   KC_pct (sc)   numeric
                   EP_pct (sc)   numeric
                   CH_pct (sc)   numeric
                   SC_pct (sc)   numeric
                   KN_pct (sc)   numeric
                   UN_pct (sc)   numeric
                   vFA (sc)      numeric
                   vFT (sc)      numeric
42                   fg_pitcher_leaders
   vFC (sc)  numeric
   vFS (sc)  numeric
   vFO (sc)  numeric
   vSI (sc)  numeric
   vSL (sc)  numeric
   vCU (sc)  numeric
   vKC (sc)  numeric
   vEP (sc)  numeric
   vCH (sc)  numeric
   vSC (sc)  numeric
   vKN (sc)  numeric
   FA-X (sc) numeric
   FT-X (sc) numeric
   FC-X (sc) numeric
   FS-X (sc) numeric
   FO-X (sc) numeric
   SI-X (sc) numeric
   SL-X (sc) numeric
   CU-X (sc) numeric
   KC-X (sc) numeric
   EP-X (sc) numeric
   CH-X (sc) numeric
   SC-X (sc) numeric
   KN-X (sc) numeric
   FA-Z (sc) numeric
   FT-Z (sc) numeric
   FC-Z (sc) numeric
   FS-Z (sc) numeric
   FO-Z (sc) numeric
   SI-Z (sc) numeric
   SL-Z (sc) numeric
   CU-Z (sc) numeric
   KC-Z (sc) numeric
   EP-Z (sc) numeric
   CH-Z (sc) numeric
   SC-Z (sc) numeric
   KN-Z (sc) numeric
   wFA (sc)  numeric
   wFT (sc)  numeric
   wFC (sc)  numeric
   wFS (sc)  numeric
   wFO (sc)  numeric
   wSI (sc)  numeric
   wSL (sc)  numeric
   wCU (sc)  numeric
   wKC (sc)  numeric
   wEP (sc)  numeric
   wCH (sc)  numeric
fg_pitcher_leaders                            43
                   wSC (sc)           numeric
                   wKN (sc)           numeric
                   wFA_C (sc)         numeric
                   wFT_C (sc)         numeric
                   wFC_C (sc)         numeric
                   wFS_C (sc)         numeric
                   wFO_C (sc)         numeric
                   wSI_C (sc)         numeric
                   wSL_C (sc)         numeric
                   wCU_C (sc)         numeric
                   wKC_C (sc)         numeric
                   wEP_C (sc)         numeric
                   wCH_C (sc)         numeric
                   wSC_C (sc)         numeric
                   wKN_C (sc)         numeric
                   O-Swing_pct (sc)   numeric
                   Z-Swing_pct (sc)   numeric
                   Swing_pct (sc)     numeric
                   O-Contact_pct (sc) numeric
                   Z-Contact_pct (sc) numeric
                   Contact_pct (sc)   numeric
                   Zone_pct (sc)      numeric
                   Pace               numeric
                   RA9-WAR            numeric
                   BIP-Wins           numeric
                   LOB-Wins           numeric
                   FDP-Wins           numeric
                   AgeRng             numeric
                   K-BB_pct           numeric
                   Pull_pct           numeric
                   Cent_pct           numeric
                   Oppo_pct           numeric
                   Soft_pct           numeric
                   Med_pct            numeric
                   Hard_pct           numeric
                   kwERA              numeric
                   TTO_pct            numeric
                   CH_pct_pi          numeric
                   CS_pct_pi          numeric
                   CU_pct_pi          numeric
                   FA_pct_pi          numeric
                   FC_pct_pi          numeric
                   FS_pct_pi          numeric
                   KN_pct_pi          numeric
                   SB_pct_pi          numeric
                   SI_pct_pi          numeric
                   SL_pct_pi          numeric
                   XX_pct_pi          numeric
44                  fg_pitcher_leaders
   vCH_pi   numeric
   vCS_pi   numeric
   vCU_pi   numeric
   vFA_pi   numeric
   vFC_pi   numeric
   vFS_pi   numeric
   vKN_pi   numeric
   vSB_pi   numeric
   vSI_pi   numeric
   vSL_pi   numeric
   vXX_pi   numeric
   CH-X_pi  numeric
   CS-X_pi  numeric
   CU-X_pi  numeric
   FA-X_pi  numeric
   FC-X_pi  numeric
   FS-X_pi  numeric
   KN-X_pi  numeric
   SB-X_pi  numeric
   SI-X_pi  numeric
   SL-X_pi  numeric
   XX-X_pi  numeric
   CH-Z_pi  numeric
   CS-Z_pi  numeric
   CU-Z_pi  numeric
   FA-Z_pi  numeric
   FC-Z_pi  numeric
   FS-Z_pi  numeric
   KN-Z_pi  numeric
   SB-Z_pi  numeric
   SI-Z_pi  numeric
   SL-Z_pi  numeric
   XX-Z_pi  numeric
   wCH_pi   numeric
   wCS_pi   numeric
   wCU_pi   numeric
   wFA_pi   numeric
   wFC_pi   numeric
   wFS_pi   numeric
   wKN_pi   numeric
   wSB_pi   numeric
   wSI_pi   numeric
   wSL_pi   numeric
   wXX_pi   numeric
   wCH_C_pi numeric
   wCS_C_pi numeric
   wCU_C_pi numeric
   wFA_C_pi numeric
fg_pitch_leaders                                                                                    45
                                   wFC_C_pi              numeric
                                   wFS_C_pi              numeric
                                   wKN_C_pi              numeric
                                   wSB_C_pi              numeric
                                   wSI_C_pi              numeric
                                   wSL_C_pi              numeric
                                   wXX_C_pi              numeric
                                   O-Swing_pct_pi        numeric
                                   Z-Swing_pct_pi        numeric
                                   Swing_pct_pi          numeric
                                   O-Contact_pct_pi      numeric
                                   Z-Contact_pct_pi      numeric
                                   Contact_pct_pi        numeric
                                   Zone_pct_pi           numeric
                                   Pace_pi               numeric
                                   Dol                   numeric
Examples
       fg_pitcher_leaders(x = 2015, y = 2015, qual = 150)
  fg_pitch_leaders            (legacy) Scrape Pitcher Leaderboards from FanGraphs
Description
    (legacy) Scrape Pitcher Leaderboards from FanGraphs
Usage
    fg_pitch_leaders(
       x,
       y,
       league = "all",
       qual = "y",
       pitcher_type = "pit",
       ind = 1
    )
Arguments
    x                 First season for which you want data.
    y                 Last season for which you want data. If multiple years selected, data returned
                      will be aggregate data for the date range. If y = x, function will return single-
                      season data.
46                                                                                          fg_team_batter
     league             Option for limiting results to different leagues or overall results. Options are
                        "al", "nl", or "all".
     qual               Whether you want only batters/pitchers that qualified in a given season, or the
                        minimum number of plate appearances for inclusion. If you only want qualified
                        hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                        the number desired. Defaults to "y".
     pitcher_type       Whether you want only starting pitchers, relievers, or all pitchers that meet the
                        criteria specified in the qual argument. Options include "pit", "sta", "rel".
     ind                Whether or not to break the seasons out individual, or roll them up together. 1 =
                        split seasons, 0 = aggregate seasons.
Value
     A data frame of pitcher data.
   fg_team_batter               Scrape Team Batter Leaderboards from FanGraphs
Description
     This function allows you to scrape all leaderboard statistics (basic and advanced) from FanGraphs.com.
Usage
     fg_team_batter(x, y, league = "all", qual = "y", ind = 1, exc_p = TRUE)
Arguments
     x                  First season for which you want data.
     y                  Last season for which you want data. If multiple years selected, data returned
                        will be aggregate data for the date range. If y = x, function will return single-
                        season data.
     league             Option for limiting results to different leagues or overall results. Options are
                        "al", "nl", or "all".
     qual               Whether you want only batters/pitchers that qualified in a given season, or the
                        minimum number of plate appearances for inclusion. If you only want qualified
                        hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                        the number desired. Defaults to "y".
     ind                Whether or not to break the seasons out individual, or roll them up together. 1 =
                        split seasons, 0 = aggregate seasons.
     exc_p              (logical) Whether or not to exclude pitchers from the batter leaderboards. TRUE
                        = exclude pitchers, FALSE = retain pitchers.
Value
     A data frame of batter data.
fg_team_batter                     47
               col_name  types
                Season   character
                #        character
                Team     character
                G        numeric
                AB       numeric
                PA       numeric
                H        numeric
                1B       numeric
                2B       numeric
                3B       numeric
                HR       numeric
                R        numeric
                RBI      numeric
                BB       numeric
                IBB      numeric
                SO       numeric
                HBP      numeric
                SF       numeric
                SH       numeric
                GDP      numeric
                SB       numeric
                CS       numeric
                AVG      numeric
                GB       numeric
                FB       numeric
                LD       numeric
                IFFB     numeric
                Pitches  numeric
                Balls    numeric
                Strikes  numeric
                IFH      numeric
                BU       numeric
                BUH      numeric
                BB_pct   numeric
                K_pct    numeric
                BB_K     numeric
                OBP      numeric
                SLG      numeric
                OPS      numeric
                ISO      numeric
                BABIP    numeric
                GB_FB    numeric
                LD_pct   numeric
                GB_pct   numeric
                FB_pct   numeric
                IFFB_pct numeric
                HR_FB    numeric
48                   fg_team_batter
   IFH_pct   numeric
   BUH_pct   numeric
   wOBA      numeric
   wRAA      numeric
   wRC       numeric
   Bat       numeric
   Fld       numeric
   Rep       numeric
   Pos       numeric
   RAR       numeric
   WAR       numeric
   Dol       numeric
   Spd       numeric
   wRC_plus  numeric
   WPA       numeric
   WPA_minus numeric
   WPA_plus  numeric
   RE24      numeric
   REW       numeric
   pLI       numeric
   phLI      numeric
   PH        numeric
   WPA_LI    numeric
   Clutch    numeric
   FBall_pct numeric
   FBv       numeric
   SL_pct    numeric
   SLv       numeric
   CT_pct    numeric
   CTv       numeric
   CB_pct    numeric
   CBv       numeric
   CH_pct    numeric
   CHv       numeric
   SF_pct    numeric
   SFv       numeric
   KN_pct    numeric
   KNv       numeric
   XX_pct    numeric
   PO_pct    numeric
   wFB       numeric
   wSL       numeric
   wCT       numeric
   wCB       numeric
   wCH       numeric
   wSF       numeric
   wKN       numeric
   wFB_C     numeric
fg_team_batter                       49
               wSL_C         numeric
               wCT_C         numeric
               wCB_C         numeric
               wCH_C         numeric
               wSF_C         numeric
               wKN_C         numeric
               O-Swing_pct   numeric
               Z-Swing_pct   numeric
               Swing_pct     numeric
               O-Contact_pct numeric
               Z-Contact_pct numeric
               Contact_pct   numeric
               Zone_pct      numeric
               F-Strike_pct  numeric
               SwStr_pct     numeric
               BsR           numeric
               FA_pct (sc)   numeric
               FT_pct (sc)   numeric
               FC_pct (sc)   numeric
               FS_pct (sc)   numeric
               FO_pct (sc)   numeric
               SI_pct (sc)   numeric
               SL_pct (sc)   numeric
               CU_pct (sc)   numeric
               KC_pct (sc)   numeric
               EP_pct (sc)   numeric
               CH_pct (sc)   numeric
               SC_pct (sc)   numeric
               KN_pct (sc)   numeric
               UN_pct (sc)   numeric
               vFA (sc)      numeric
               vFT (sc)      numeric
               vFC (sc)      numeric
               vFS (sc)      numeric
               vFO (sc)      numeric
               vSI (sc)      numeric
               vSL (sc)      numeric
               vCU (sc)      numeric
               vKC (sc)      numeric
               vEP (sc)      numeric
               vCH (sc)      numeric
               vSC (sc)      numeric
               vKN (sc)      numeric
               FA-X (sc)     numeric
               FT-X (sc)     numeric
               FC-X (sc)     numeric
               FS-X (sc)     numeric
               FO-X (sc)     numeric
50                          fg_team_batter
   SI-X (sc)        numeric
   SL-X (sc)        numeric
   CU-X (sc)        numeric
   KC-X (sc)        numeric
   EP-X (sc)        numeric
   CH-X (sc)        numeric
   SC-X (sc)        numeric
   KN-X (sc)        numeric
   FA-Z (sc)        numeric
   FT-Z (sc)        numeric
   FC-Z (sc)        numeric
   FS-Z (sc)        numeric
   FO-Z (sc)        numeric
   SI-Z (sc)        numeric
   SL-Z (sc)        numeric
   CU-Z (sc)        numeric
   KC-Z (sc)        numeric
   EP-Z (sc)        numeric
   CH-Z (sc)        numeric
   SC-Z (sc)        numeric
   KN-Z (sc)        numeric
   wFA (sc)         numeric
   wFT (sc)         numeric
   wFC (sc)         numeric
   wFS (sc)         numeric
   wFO (sc)         numeric
   wSI (sc)         numeric
   wSL (sc)         numeric
   wCU (sc)         numeric
   wKC (sc)         numeric
   wEP (sc)         numeric
   wCH (sc)         numeric
   wSC (sc)         numeric
   wKN (sc)         numeric
   wFA_C (sc)       numeric
   wFT_C (sc)       numeric
   wFC_C (sc)       numeric
   wFS_C (sc)       numeric
   wFO_C (sc)       numeric
   wSI_C (sc)       numeric
   wSL_C (sc)       numeric
   wCU_C (sc)       numeric
   wKC_C (sc)       numeric
   wEP_C (sc)       numeric
   wCH_C (sc)       numeric
   wSC_C (sc)       numeric
   wKN_C (sc)       numeric
   O-Swing_pct (sc) numeric
fg_team_batter                            51
               Z-Swing_pct (sc)   numeric
               Swing_pct (sc)     numeric
               O-Contact_pct (sc) numeric
               Z-Contact_pct (sc) numeric
               Contact_pct (sc)   numeric
               Zone_pct (sc)      numeric
               Pace               numeric
               Def                numeric
               wSB                numeric
               UBR                numeric
               AgeRng             numeric
               Off                numeric
               Lg                 numeric
               wGDP               numeric
               Pull_pct           numeric
               Cent_pct           numeric
               Oppo_pct           numeric
               Soft_pct           numeric
               Med_pct            numeric
               Hard_pct           numeric
               TTO_pct            numeric
               CH_pct_pi          numeric
               CS_pct_pi          numeric
               CU_pct_pi          numeric
               FA_pct_pi          numeric
               FC_pct_pi          numeric
               FS_pct_pi          numeric
               KN_pct_pi          numeric
               SB_pct_pi          numeric
               SI_pct_pi          numeric
               SL_pct_pi          numeric
               XX_pct_pi          numeric
               vCH_pi             numeric
               vCS_pi             numeric
               vCU_pi             numeric
               vFA_pi             numeric
               vFC_pi             numeric
               vFS_pi             numeric
               vKN_pi             numeric
               vSB_pi             numeric
               vSI_pi             numeric
               vSL_pi             numeric
               vXX_pi             numeric
               CH-X_pi            numeric
               CS-X_pi            numeric
               CU-X_pi            numeric
               FA-X_pi            numeric
               FC-X_pi            numeric
52                          fg_team_batter
   FS-X_pi          numeric
   KN-X_pi          numeric
   SB-X_pi          numeric
   SI-X_pi          numeric
   SL-X_pi          numeric
   XX-X_pi          numeric
   CH-Z_pi          numeric
   CS-Z_pi          numeric
   CU-Z_pi          numeric
   FA-Z_pi          numeric
   FC-Z_pi          numeric
   FS-Z_pi          numeric
   KN-Z_pi          numeric
   SB-Z_pi          numeric
   SI-Z_pi          numeric
   SL-Z_pi          numeric
   XX-Z_pi          numeric
   wCH_pi           numeric
   wCS_pi           numeric
   wCU_pi           numeric
   wFA_pi           numeric
   wFC_pi           numeric
   wFS_pi           numeric
   wKN_pi           numeric
   wSB_pi           numeric
   wSI_pi           numeric
   wSL_pi           numeric
   wXX_pi           numeric
   wCH_C_pi         numeric
   wCS_C_pi         numeric
   wCU_C_pi         numeric
   wFA_C_pi         numeric
   wFC_C_pi         numeric
   wFS_C_pi         numeric
   wKN_C_pi         numeric
   wSB_C_pi         numeric
   wSI_C_pi         numeric
   wSL_C_pi         numeric
   wXX_C_pi         numeric
   O-Swing_pct_pi   numeric
   Z-Swing_pct_pi   numeric
   Swing_pct_pi     numeric
   O-Contact_pct_pi numeric
   Z-Contact_pct_pi numeric
   Contact_pct_pi   numeric
   Zone_pct_pi      numeric
   Pace_pi          numeric
fg_team_pitcher                                                                                       53
Examples
      try(fg_team_batter(x = 2015, y = 2015, qual = 200))
  fg_team_pitcher              Scrape Team Pitcher Leaderboards from FanGraphs
Description
    Scrape Team Pitcher Leaderboards from FanGraphs
Usage
    fg_team_pitcher(x, y, league = "all", qual = 0, pitcher_type = "pit", ind = 1)
Arguments
    x                  First season for which you want data.
    y                  Last season for which you want data. If multiple years selected, data returned
                       will be aggregate data for the date range. If y = x, function will return single-
                       season data.
    league             Option for limiting results to different leagues or overall results. Options are
                       "al", "nl", or "all".
    qual               Whether you want only batters/pitchers that qualified in a given season, or the
                       minimum number of plate appearances for inclusion. If you only want qualified
                       hitters, use qual. If a minimum number of plate appearaces/innings pitched, use
                       the number desired. Defaults to "y".
    pitcher_type       Whether you want only starting pitchers, relievers, or all pitchers that meet the
                       criteria specified in the qual argument. Options include "pit", "sta", "rel".
    ind                Whether or not to break the seasons out individual, or roll them up together. 1 =
                       split seasons, 0 = aggregate seasons.
Value
    A data frame of pitcher data.
                                    col_name               types
                                     Season                character
                                     #                     character
                                     Team                  character
                                     W                     numeric
                                     L                     numeric
                                     ERA                   numeric
                                     G                     numeric
                                     GS                    numeric
54                   fg_team_pitcher
   CG        numeric
   ShO       numeric
   SV        numeric
   BS        numeric
   IP        numeric
   TBF       numeric
   H         numeric
   R         numeric
   ER        numeric
   HR        numeric
   BB        numeric
   IBB       numeric
   HBP       numeric
   WP        numeric
   BK        numeric
   SO        numeric
   GB        numeric
   FB        numeric
   LD        numeric
   IFFB      numeric
   Balls     numeric
   Strikes   numeric
   Pitches   numeric
   RS        numeric
   IFH       numeric
   BU        numeric
   BUH       numeric
   K_9       numeric
   BB_9      numeric
   K_BB      numeric
   H_9       numeric
   HR_9      numeric
   AVG       numeric
   WHIP      numeric
   BABIP     numeric
   LOB_pct   numeric
   FIP       numeric
   GB_FB     numeric
   LD_pct    numeric
   GB_pct    numeric
   FB_pct    numeric
   IFFB_pct  numeric
   HR_FB     numeric
   IFH_pct   numeric
   BUH_pct   numeric
   Starting  numeric
   Start_IP  numeric
   Relieving numeric
fg_team_pitcher                   55
                Relief_IP numeric
                RAR       numeric
                WAR       numeric
                Dollars   numeric
                tERA      numeric
                xFIP      numeric
                WPA       numeric
                WPA_minus numeric
                WPA_plus  numeric
                RE24      numeric
                REW       numeric
                pLI       numeric
                inLI      numeric
                gmLI      numeric
                exLI      numeric
                Pulls     numeric
                WPA_LI    numeric
                Clutch    numeric
                FBall_pct numeric
                FBv       numeric
                SL_pct    numeric
                SLv       numeric
                CT_pct    numeric
                CTv       numeric
                CB_pct    numeric
                CBv       numeric
                CH_pct    numeric
                CHv       numeric
                SF_pct    numeric
                SFv       numeric
                KN_pct    numeric
                KNv       numeric
                XX_pct    numeric
                PO_pct    numeric
                wFB       numeric
                wSL       numeric
                wCT       numeric
                wCB       numeric
                wCH       numeric
                wSF       numeric
                wKN       numeric
                wFB_C     numeric
                wSL_C     numeric
                wCT_C     numeric
                wCB_C     numeric
                wCH_C     numeric
                wSF_C     numeric
                wKN_C     numeric
56                       fg_team_pitcher
   O-Swing_pct   numeric
   Z-Swing_pct   numeric
   Swing_pct     numeric
   O-Contact_pct numeric
   Z-Contact_pct numeric
   Contact_pct   numeric
   Zone_pct      numeric
   F-Strike_pct  numeric
   SwStr_pct     numeric
   HLD           numeric
   SD            numeric
   MD            numeric
   ERA-          numeric
   FIP-          numeric
   xFIP-         numeric
   K_pct         numeric
   BB_pct        numeric
   SIERA         numeric
   RS_9          numeric
   E-F           numeric
   FA_pct (sc)   numeric
   FT_pct (sc)   numeric
   FC_pct (sc)   numeric
   FS_pct (sc)   numeric
   FO_pct (sc)   numeric
   SI_pct (sc)   numeric
   SL_pct (sc)   numeric
   CU_pct (sc)   numeric
   KC_pct (sc)   numeric
   EP_pct (sc)   numeric
   CH_pct (sc)   numeric
   SC_pct (sc)   numeric
   KN_pct (sc)   numeric
   UN_pct (sc)   numeric
   vFA (sc)      numeric
   vFT (sc)      numeric
   vFC (sc)      numeric
   vFS (sc)      numeric
   vFO (sc)      numeric
   vSI (sc)      numeric
   vSL (sc)      numeric
   vCU (sc)      numeric
   vKC (sc)      numeric
   vEP (sc)      numeric
   vCH (sc)      numeric
   vSC (sc)      numeric
   vKN (sc)      numeric
   FA-X (sc)     numeric
fg_team_pitcher                    57
                FT-X (sc)  numeric
                FC-X (sc)  numeric
                FS-X (sc)  numeric
                FO-X (sc)  numeric
                SI-X (sc)  numeric
                SL-X (sc)  numeric
                CU-X (sc)  numeric
                KC-X (sc)  numeric
                EP-X (sc)  numeric
                CH-X (sc)  numeric
                SC-X (sc)  numeric
                KN-X (sc)  numeric
                FA-Z (sc)  numeric
                FT-Z (sc)  numeric
                FC-Z (sc)  numeric
                FS-Z (sc)  numeric
                FO-Z (sc)  numeric
                SI-Z (sc)  numeric
                SL-Z (sc)  numeric
                CU-Z (sc)  numeric
                KC-Z (sc)  numeric
                EP-Z (sc)  numeric
                CH-Z (sc)  numeric
                SC-Z (sc)  numeric
                KN-Z (sc)  numeric
                wFA (sc)   numeric
                wFT (sc)   numeric
                wFC (sc)   numeric
                wFS (sc)   numeric
                wFO (sc)   numeric
                wSI (sc)   numeric
                wSL (sc)   numeric
                wCU (sc)   numeric
                wKC (sc)   numeric
                wEP (sc)   numeric
                wCH (sc)   numeric
                wSC (sc)   numeric
                wKN (sc)   numeric
                wFA_C (sc) numeric
                wFT_C (sc) numeric
                wFC_C (sc) numeric
                wFS_C (sc) numeric
                wFO_C (sc) numeric
                wSI_C (sc) numeric
                wSL_C (sc) numeric
                wCU_C (sc) numeric
                wKC_C (sc) numeric
                wEP_C (sc) numeric
58                            fg_team_pitcher
   wCH_C (sc)         numeric
   wSC_C (sc)         numeric
   wKN_C (sc)         numeric
   O-Swing_pct (sc)   numeric
   Z-Swing_pct (sc)   numeric
   Swing_pct (sc)     numeric
   O-Contact_pct (sc) numeric
   Z-Contact_pct (sc) numeric
   Contact_pct (sc)   numeric
   Zone_pct (sc)      numeric
   Pace               numeric
   RA9-WAR            numeric
   BIP-Wins           numeric
   LOB-Wins           numeric
   FDP-Wins           numeric
   AgeRng             numeric
   K-BB_pct           numeric
   Pull_pct           numeric
   Cent_pct           numeric
   Oppo_pct           numeric
   Soft_pct           numeric
   Med_pct            numeric
   Hard_pct           numeric
   kwERA              numeric
   TTO_pct            numeric
   CH_pct_pi          numeric
   CS_pct_pi          numeric
   CU_pct_pi          numeric
   FA_pct_pi          numeric
   FC_pct_pi          numeric
   FS_pct_pi          numeric
   KN_pct_pi          numeric
   SB_pct_pi          numeric
   SI_pct_pi          numeric
   SL_pct_pi          numeric
   XX_pct_pi          numeric
   vCH_pi             numeric
   vCS_pi             numeric
   vCU_pi             numeric
   vFA_pi             numeric
   vFC_pi             numeric
   vFS_pi             numeric
   vKN_pi             numeric
   vSB_pi             numeric
   vSI_pi             numeric
   vSL_pi             numeric
   vXX_pi             numeric
   CH-X_pi            numeric
fg_team_pitcher                          59
                CS-X_pi          numeric
                CU-X_pi          numeric
                FA-X_pi          numeric
                FC-X_pi          numeric
                FS-X_pi          numeric
                KN-X_pi          numeric
                SB-X_pi          numeric
                SI-X_pi          numeric
                SL-X_pi          numeric
                XX-X_pi          numeric
                CH-Z_pi          numeric
                CS-Z_pi          numeric
                CU-Z_pi          numeric
                FA-Z_pi          numeric
                FC-Z_pi          numeric
                FS-Z_pi          numeric
                KN-Z_pi          numeric
                SB-Z_pi          numeric
                SI-Z_pi          numeric
                SL-Z_pi          numeric
                XX-Z_pi          numeric
                wCH_pi           numeric
                wCS_pi           numeric
                wCU_pi           numeric
                wFA_pi           numeric
                wFC_pi           numeric
                wFS_pi           numeric
                wKN_pi           numeric
                wSB_pi           numeric
                wSI_pi           numeric
                wSL_pi           numeric
                wXX_pi           numeric
                wCH_C_pi         numeric
                wCS_C_pi         numeric
                wCU_C_pi         numeric
                wFA_C_pi         numeric
                wFC_C_pi         numeric
                wFS_C_pi         numeric
                wKN_C_pi         numeric
                wSB_C_pi         numeric
                wSI_C_pi         numeric
                wSL_C_pi         numeric
                wXX_C_pi         numeric
                O-Swing_pct_pi   numeric
                Z-Swing_pct_pi   numeric
                Swing_pct_pi     numeric
                O-Contact_pct_pi numeric
                Z-Contact_pct_pi numeric
60                                                                                               fip_plus
                                       Contact_pct_pi         numeric
                                       Zone_pct_pi            numeric
                                       Pace_pi                numeric
                                       Dol                    numeric
Examples
       fg_team_pitcher(x = 2015, y = 2015, qual = 150)
   fip_plus                      Calculate FIP and related metrics for any set of data
Description
     This function allows you to calculate FIP and related metrics for any given set of data, provided
     the right variables are in the data set. The function currently returns both FIP per inning pitched,
     wOBA against (based on batters faced), and wOBA against per instance of fair contact.
Usage
     fip_plus(df)
Arguments
     df                  A data frame of statistics that includes, at a minimum, the following columns:
                         IP (innings pitched), BF (batters faced), uBB (unintentional walks), HBP (Hit
                         By Pitch), x1B (singles), x2B (doubles), x3B (triples), HR (home runs), AB
                         (at-bats), SH (sacrifice hits), SO (strike outs), and season.
Value
     Returns a tibble with the following columns:
                                     col_name                   types
                                      bbref_id                  character
                                      season                    integer
                                      Name                      character
                                      Age                       numeric
                                      Level                     character
                                      Team                      character
                                      G                         numeric
                                      GS                        numeric
                                      W                         numeric
                                      L                         numeric
                                      SV                        numeric
fip_plus                                                      61
                                IP                    numeric
                                H                     numeric
                                R                     numeric
                                ER                    numeric
                                uBB                   numeric
                                BB                    numeric
                                SO                    numeric
                                HR                    numeric
                                HBP                   numeric
                                ERA                   numeric
                                AB                    numeric
                                X1B                   numeric
                                X2B                   numeric
                                X3B                   numeric
                                IBB                   numeric
                                GDP                   numeric
                                SF                    numeric
                                SB                    numeric
                                CS                    numeric
                                PO                    numeric
                                BF                    numeric
                                Pit                   numeric
                                Str                   numeric
                                StL                   numeric
                                StS                   numeric
                                GB.FB                 numeric
                                LD                    numeric
                                PU                    numeric
                                WHIP                  numeric
                                BAbip                 numeric
                                SO9                   numeric
                                SO.W                  numeric
                                SO_perc               numeric
                                uBB_perc              numeric
                                SO_uBB                numeric
                                FIP                   numeric
                                wOBA_against          numeric
                                wOBA_CON_against      numeric
Examples
       df <- bref_daily_pitcher("2015-04-05", "2015-04-30")
       try(fip_plus(df))
62                                                                                             get_draft_mlb
   get_batting_orders            (legacy) Retrieve batting orders for a given MLB game
Description
     (legacy) Retrieve batting orders for a given MLB game
Usage
     get_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
   get_draft_mlb                 (legacy) Retrieve draft pick information by year
Description
     (legacy) Retrieve draft pick information by year
Usage
     get_draft_mlb(year)
Arguments
     year                The year for which to return data
Value
     Returns a tibble with information for every draft pick in every round for the year requested
get_game_info_mlb                                                                                      63
  get_game_info_mlb             (legacy) Retrieve additional game information for major and mi-
                                nor league games
Description
    (legacy) Retrieve additional game information for major and minor league games
Usage
    get_game_info_mlb(game_pk)
Arguments
    game_pk             The unique game_pk identifier for the game
Value
    Returns a tibble that includes supplemental information, such as weather, official scorer, attendance,
    etc., for the game_pk provided
  get_game_info_sup_petti
                                (legacy) Download a data frame of supplemental data about MLB
                                games since 2008.
Description
    (legacy) Download a data frame of supplemental data about MLB games since 2008.
Usage
    get_game_info_sup_petti()
Value
    Function returns a tibble with various columns, including:
        •  game_pk
        •  game_date
        •  venue id
        •  attendance
        •  game temperature
        •  wind speed
        •  direction
        •  start time
        •  end time
64                                                                            get_ncaa_baseball_pbp
   get_game_pks_mlb             (legacy) Get MLB Game Info by Date and Level
Description
     (legacy) Get MLB Game Info by Date and Level
Usage
     get_game_pks_mlb(date, level_ids = c(1))
Arguments
     date               The date for which you want to find game_pk values for MLB games
     level_ids          A numeric vector with ids for each level where game_pks are desired. See below
                        for a reference of level ids.
Value
     Returns a tibble that includes game_pk values and additional information for games scheduled or
     played
   get_ncaa_baseball_pbp (legacy) Get Play-By-Play Data for NCAA Baseball Games
Description
     (legacy) Get Play-By-Play Data for NCAA Baseball Games
     (legacy) Get Play-By-Play Data for NCAA Baseball Games
Usage
     get_ncaa_baseball_pbp(
        game_info_url = NA_character_,
        game_pbp_url = NA_character_,
        raw_html_to_disk = FALSE,
        raw_html_path = "/",
        read_from_file = FALSE,
        file = NA_character_,
        ...
     )
     ncaa_baseball_pbp(
        game_info_url = NA_character_,
        game_pbp_url = NA_character_,
get_ncaa_game_logs                                                                                     65
       raw_html_to_disk = FALSE,
       raw_html_path = "/",
       read_from_file = FALSE,
       file = NA_character_,
       ...
    )
Arguments
    game_info_url     The url for the game’s boxscore data. This can be found using the ncaa_schedule_info
                      function.
    game_pbp_url      The url for the game’s play-by-play data. This can be found using the ncaa_schedule_info
                      function.
    raw_html_to_disk
                      Write raw html to disk (saves as game_pbp_id.html in raw_html_path direc-
                      tory)
    raw_html_path     Directory path to write raw html
    read_from_file Read from raw html on disk
    file              File with full path to read raw html
    ...               Additional arguments passed to an underlying function like httr.
Value
    A data frame with play-by-play data for an individual game.
    A data frame with play-by-play data for an individual game.
  get_ncaa_game_logs         (legacy) Get NCAA Baseball Game Logs
Description
    (legacy) Get NCAA Baseball Game Logs
Usage
    get_ncaa_game_logs(player_id, year, type = "batting", span = "game", ...)
Arguments
    player_id         A player’s unique id. Can be found using the get_ncaa_baseball_roster function.
    year              The year of interest.
    type              The kind of statistics you want to return. Current options are ’batting’ or ’pitch-
                      ing’.
    span              The span of time; can either be ’game’ for game logs in a season, or ’career’
                      which returns seasonal stats for a player’s career.
    ...               Additional arguments passed to an underlying function like httr.
66                                                                                get_ncaa_park_factor
Value
     A data frame containing player and school information as well as game by game statistics
   get_ncaa_lineups             (legacy) Retrieve lineups for a given NCAA game via its
                                game_info_url
Description
     (legacy) Retrieve lineups for a given NCAA game via its game_info_url
Usage
     get_ncaa_lineups(game_info_url = NULL, ...)
Arguments
     game_info_url       The unique game info url
     ...                 Additional arguments passed to an underlying function like httr.
Value
     Returns a tibble of each school’s starting lineup and starting pitcher
   get_ncaa_park_factor         (legacy) Get Park Effects for NCAA Baseball Teams
Description
     (legacy) Get Park Effects for NCAA Baseball Teams
Usage
     get_ncaa_park_factor(team_id, years, type = "conference", ...)
Arguments
     team_id             The team’s unique NCAA id.
     years               The season or seasons (i.e. use 2016 for the 2015-2016 season, etc., limited to
                         just 2013-2020 seasons).
     type                default is conference. the conference parameter adjusts for the conference the
                         school plays in, the division parameter calculates based on the division the
                         school plays in 1,2,or 3. Defaults to ’conference’.
     ...                 Additional arguments passed to an underlying function like httr.
get_ncaa_schedule_info                                                                               67
Value
    A data frame with the following fields: school, home_game, away_game, runs_scored_home,
    runs_allowed_home, run_scored_away, runs_allowed_away, base_pf (base park factor), home_game_adj
    (an adjustment for the percentage of home games played) final_pf (park factor after adjustments)
  get_ncaa_schedule_info
                                 (legacy) Get Schedule and Results for NCAA Baseball Teams
Description
    (legacy) Get Schedule and Results for NCAA Baseball Teams
Usage
    get_ncaa_schedule_info(team_id = NULL, year = NULL, pbp_links = FALSE, ...)
Arguments
    team_id              The team’s unique NCAA id.
    year                 The season (i.e. use 2016 for the 2015-2016 season, etc.)
    pbp_links            Logical parameter to run process for scraping play_by_play urls for each game
    ...                  Additional arguments passed to an underlying function like httr.
Value
    A data frame with the following fields: date, opponent, result, score, innings (if more than regula-
    tion), and the url for the game itself.
  get_pbp_mlb                    (legacy) Acquire pitch-by-pitch data for Major and Minor League
                                 games
Description
    (legacy) Acquire pitch-by-pitch data for Major and Minor League games
    (legacy) Acquire pitch-by-pitch data for Major and Minor League games
Usage
    get_pbp_mlb(game_pk)
    get_pbp_mlb(game_pk)
68                                                                                   get_retrosheet_data
Arguments
     game_pk             The date for which you want to find game_pk values for MLB games
Value
     Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch
     level.
     Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch
     level.
   get_probables_mlb             (legacy) Retrieve probable starters for a given MLB game
Description
     (legacy) Retrieve probable starters for a given MLB game
Usage
     get_probables_mlb(game_pk)
Arguments
     game_pk             The unique game_pk identifier for the game
Value
     Returns a tibble that includes probable starting pitchers and the home plate umpire for the game_pk
     requested
   get_retrosheet_data           (legacy) Get, Parse, and Format Retrosheet Event and Roster Files
Description
     (legacy) Get, Parse, and Format Retrosheet Event and Roster Files
Usage
     get_retrosheet_data(
        path_to_directory = NULL,
        years_to_acquire = most_recent_mlb_season() - 1,
        sequence_years = FALSE
     )
get_umpire_ids_petti                                                                                   69
Arguments
    path_to_directory
                        (default: NULL) A file path that if set, either:
                          1. creates a new directory, or
                          2. uses the path to an existing directory
    years_to_acquire
                        (format: YYYY) The seasons to collect. Single, multiple, and sequential years
                        can be passed. If passing multiple years, enclose in a vector (i.e. c(2017,2018)).
                        Defaults to most_recent_mlb_season().
    sequence_years (logical, default: FALSE): If the seasons passed in the years_to_acquire param-
                        eter should be sequenced so that the function returns all years including and
                        between the vector passed, set the argument to TRUE. Defaults to FALSE.
Value
    If path_to_directory is not set (default), the process will return a named list of tibbles: ’events’
    and ’rosters’ for each season provided to years_to_acquire If path_to_directory is set, will
    also write two csv files to the unzipped directory: 1) a combined csv of the event data for a given
    year and 2) a combined csv of each team’s roster for each year provided to years_to_acquire
  get_umpire_ids_petti          (legacy) Download a data frame of all umpires and their MLBAM
                                IDs for games since 2008
Description
    (legacy) Download a data frame of all umpires and their MLBAM IDs for games since 2008
Usage
    get_umpire_ids_petti()
Value
    Function returns a tibble with the following columns:
        • id
        • position,
        • name
        • game_pk
        • game_date
70                                                                                           ggspraychart
   ggspraychart                 Generate spray charts with ggplot2
Description
     This function allows you to create spray charts with ggplots given a data frame with batted ball
     location coordinates.
Usage
     ggspraychart(
        data,
        x_value = "hc_x",
        y_value = "-hc_y",
        fill_value = NULL,
        fill_palette = NULL,
        fill_legend_title = NULL,
        density = FALSE,
        bin_size = 15,
        point_alpha = 0.75,
        point_size = 2,
        frame = NULL
     )
Arguments
     data               A data frame that includes batted ball coordinates. Typically, this coordinates
                        will come from the GameDay xml feed or downloads from baseballsavant.com
     x_value            The x coordindate. Typically hc_x.
     y_value            The y coordinate. Typically hc_y. You generally need the inverse or negative of
                        the hc_y values, so it is recommended you calculate before plotting.
     fill_value         The categorical variable that you want the geom_points to base the fill on. Pass
                        as a string. If left blank, defaults to blue.
     fill_palette       An object containing a customer palette to be used with ggplot2::scale_fill_manual.
     fill_legend_title
                        A string containing a custom legend title to be used with ggplot2::scale_fill_manual.
     density            Chooses between a 2d density plot or a point plot. Defaults to FALSE.
     bin_size           Size of bins used when building a density plot. Defaults to 15.
     point_alpha        Alpha value whenever geom_point is used. Defaults to .75. Recommend .3 for
                        density plots. To remove points on density points set use point_alpha = 0.
     point_size         Set the size of geom_point if used.
     frame              Variable to use as the frame argument if using gganimate to create animated
                        plots. For density plots be sure your variable is a factor.
label_statcast_imputed_data                                                                            71
Details
     ggspraychart(df, x_value = "hc_x", y_value = "-hc_y", fill_value = "events")
Value
     A plot of the spraychart for the supplied dataset
   label_statcast_imputed_data
                                 Label Statcast data as imputed
Description
     Based on a series of heuristics, this function attempts to label Statcast data for which the launch
     angle and speed have been imputed.
Usage
     label_statcast_imputed_data(
       statcast_df,
       impute_file = NULL,
       inverse_precision = 10000
     )
Arguments
     statcast_df         A dataframe containing Statcast batted ball data
     impute_file         A CSV file giving the launch angle, launch speed, bb_type, events fields to label
                         as imputed. if NULL then it’s read from the extdata folder of the package.
     inverse_precision
                         inverse of how many digits to truncate the launch angle and speed to for com-
                         parison. Default is 10000, i.e. keep 4 digits of precision.
Value
     A copy of the input dataframe with a new column imputed appended. imputed is 1 if launch angle
     and launch speed are likely imputed, 0 otherwise. Returns a tibble with the following columns:
                             col_name                                types
                              pitch_type                             character
                              game_date                              Date
                              release_speed                          numeric
                              release_pos_x                          numeric
                              release_pos_z                          numeric
                              player_name                            character
                              batter                                 numeric
                              pitcher                                numeric
72                                 label_statcast_imputed_data
   events                  character
   description             character
   spin_dir                logical
   spin_rate_deprecated    logical
   break_angle_deprecated  logical
   break_length_deprecated logical
   zone                    numeric
   des                     character
   game_type               character
   stand                   character
   p_throws                character
   home_team               character
   away_team               character
   type                    character
   hit_location            integer
   bb_type                 character
   balls                   integer
   strikes                 integer
   game_year               integer
   pfx_x                   numeric
   pfx_z                   numeric
   plate_x                 numeric
   plate_z                 numeric
   on_3b                   numeric
   on_2b                   numeric
   on_1b                   numeric
   outs_when_up            integer
   inning                  numeric
   inning_topbot           character
   hc_x                    numeric
   hc_y                    numeric
   tfs_deprecated          logical
   tfs_zulu_deprecated     logical
   fielder_2               numeric
   umpire                  logical
   sv_id                   logical
   vx0                     numeric
   vy0                     numeric
   vz0                     numeric
   ax                      numeric
   ay                      numeric
   az                      numeric
   sz_top                  numeric
   sz_bot                  numeric
   hit_distance_sc         numeric
   launch_speed            numeric
   launch_angle            numeric
   effective_speed         numeric
label_statcast_imputed_data                                           73
                           release_spin_rate                numeric
                           release_extension                numeric
                           game_pk                          numeric
                           pitcher_1                        numeric
                           fielder_2_1                      numeric
                           fielder_3                        numeric
                           fielder_4                        numeric
                           fielder_5                        numeric
                           fielder_6                        numeric
                           fielder_7                        numeric
                           fielder_8                        numeric
                           fielder_9                        numeric
                           release_pos_y                    numeric
                           estimated_ba_using_speedangle    numeric
                           estimated_woba_using_speedangle  numeric
                           woba_value                       numeric
                           woba_denom                       integer
                           babip_value                      integer
                           iso_value                        integer
                           launch_speed_angle               integer
                           at_bat_number                    numeric
                           pitch_number                     numeric
                           pitch_name                       character
                           home_score                       numeric
                           away_score                       numeric
                           bat_score                        numeric
                           fld_score                        numeric
                           post_away_score                  numeric
                           post_home_score                  numeric
                           post_bat_score                   numeric
                           post_fld_score                   numeric
                           if_fielding_alignment            character
                           of_fielding_alignment            character
                           spin_axis                        numeric
                           delta_home_win_exp               numeric
                           delta_run_exp                    numeric
                           ila                              integer
                           ils                              integer
                           imputed                          numeric
Examples
       statcast_df <- statcast_search("2017-05-01", "2017-05-02")
       sc_df <- label_statcast_imputed_data(statcast_df)
       mean(sc_df$imputed)
74                                                                                   load_game_info_sup
   linear_weights_savant Generate linear weight values for events using Baseball Savant
                                   data
Description
     This function allows a user to generate linear weight values for events using Baseball Savant data.
     Output includes both linear weights above average and linear weights above outs for home runs,
     triples, doubles, singles, walks, hit by pitches, and outs.
Usage
     linear_weights_savant(df, level = "plate appearance")
Arguments
     df                   A data frame generated from Baseball Savant that has been run through the
                          run_expectancy_code() function.
     level                Whether to calculate linear weights the plate appearance or pitch level. Defaults
                          to ’plate appearance’.
Value
     Returns a tibble with the following columns:
                                 col_name                          types
                                  events                           character
                                  linear_weights_above_average     numeric
                                  linear_weights_above_outs        numeric
Examples
        df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15",
                                    playerid = 621043, player_type = 'batter')
        df <- run_expectancy_code(df, level = "plate appearances")
        try(linear_weights_savant(df, level = "plate appearance"))
   load_game_info_sup              Download a data frame of supplemental data about MLB games
                                   since 2008.
Description
     Download a data frame of supplemental data about MLB games since 2008.
load_ncaa_baseball_pbp                                                                                  75
Usage
     load_game_info_sup()
Value
     Function returns a tibble with various columns, including:
        • game_pk
        • game_date
        • venue id
        • attendance
        • game temperature
        • wind speed
        • direction
        • start time
        • end time
Examples
       try(load_game_info_sup())
   load_ncaa_baseball_pbp
                                Load cleaned NCAA baseball play-by-play data from the base-
                                ballr data repo
Description
     helper that loads multiple seasons from the data repo either into memory or writes it into a db using
     some forwarded arguments in the dots
Usage
     load_ncaa_baseball_pbp(
       seasons = most_recent_ncaa_baseball_season(),
       ...,
       dbConnection = NULL,
       tablename = NULL
     )
76                                                                        load_ncaa_baseball_schedule
Arguments
     seasons            A vector of 4-digit years associated with given NCAA college baseball seasons.
                        (Min: 2022)
     ...                Additional arguments passed to an underlying function that writes the season
                        data into a database.
     dbConnection       A DBIConnection object, as returned by
     tablename          The name of the schedule data table within the database
Value
     Returns a tibble
Examples
       load_ncaa_baseball_pbp(seasons = 2021)
   load_ncaa_baseball_schedule
                                Load cleaned NCAA baseball schedule from the baseballr data
                                repo
Description
     helper that loads multiple seasons from the data repo either into memory or writes it into a db using
     some forwarded arguments in the dots
Usage
     load_ncaa_baseball_schedule(
       seasons = most_recent_ncaa_baseball_season(),
       ...,
       dbConnection = NULL,
       tablename = NULL
     )
Arguments
     seasons            A vector of 4-digit years associated with given NCAA college baseball seasons.
                        (Min: 2012)
     ...                Additional arguments passed to an underlying function that writes the season
                        data into a database.
     dbConnection       A DBIConnection object, as returned by
     tablename          The name of the schedule data table within the database
load_ncaa_baseball_season_ids                                                                        77
Value
     Returns a tibble
Examples
       load_ncaa_baseball_schedule(seasons = 2022)
   load_ncaa_baseball_season_ids
                                Load cleaned NCAA men’s college baseball season IDs from the
                                baseballr data repo
Description
     helper that loads multiple seasons of season IDs from the data repo either into memory or writes it
     into a db using some forwarded arguments in the dots
Usage
     load_ncaa_baseball_season_ids(..., dbConnection = NULL, tablename = NULL)
Arguments
     ...                Additional arguments passed to an underlying function that writes the season
                        data into a database.
     dbConnection       A DBIConnection object, as returned by
     tablename          The name of the data table within the database
Value
     Returns a tibble
Examples
       load_ncaa_baseball_season_ids()
78                                                                                     load_umpire_ids
   load_ncaa_baseball_teams
                                Load cleaned NCAA men’s college baseball teams from the base-
                                ballr data repo
Description
     helper that loads multiple seasons of teams from the data repo either into memory or writes it into a
     db using some forwarded arguments in the dots
Usage
     load_ncaa_baseball_teams(..., dbConnection = NULL, tablename = NULL)
Arguments
     ...                Additional arguments passed to an underlying function that writes the season
                        data into a database.
     dbConnection       A DBIConnection object, as returned by
     tablename          The name of the data table within the database
Value
     Returns a tibble
Examples
       load_ncaa_baseball_teams()
   load_umpire_ids              Download a data frame of all umpires and their mlbamids for
                                games since 2008
Description
     Download a data frame of all umpires and their mlbamids for games since 2008
Usage
     load_umpire_ids()
metrics                                                                                       79
Value
    Function returns a tibble with the following columns:
        • id
        • position
        • name
        • game_pk
        • game_date
Examples
      try(load_umpire_ids())
  metrics                      Metrics Functions Overview
Description
    fip_plus(): Calculate FIP and related metrics for any set of data.
    woba_plus() Calculate wOBA and related metrics for any set of data.
    team_consistency() Calculate Team-level Consistency.
    label_statcast_imputed_data() Label Statcast data as imputed.
    run_expectancy_code() Generate run expectancy and related measures from Baseball Savant
          data.
    linear_weights_savant() Generate linear weight values for events using Baseball Savant data.
Details
      Calculate Team-level Consistency:
         team_consistency(year=2015)
      Calculate FIP and related metrics for any set of data:
         fips_plus(df)
      Calculate wOBA and related metrics for any set of data:
         woba_plus(df)
      Label Statcast data as imputed:
         statcast_df <- scrape_statcast_savant("2017-05-01", "2017-05-02")
         sc_df <- label_statcast_imputed_data(statcast_df)
         mean(sc_df$imputed)
80                                                                        milb_pitcher_game_logs_fg
       Generate run expectancy and related measures from Baseball Savant data:
         df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15",
                                      playerid = 621043, player_type = 'batter')
         run_expectancy_code(df, level = "plate appearances")
       Generate linear weight values for events using Baseball Savant data:
         df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15",
                                      playerid = 621043, player_type = 'batter')
         df <- run_expectancy_code(df, level = "plate appearances")
         linear_weights_savant(df, level = "plate appearance")
   milb_batter_game_logs_fg
                               (legacy) Scrape MiLB game logs for batters from FanGraphs
Description
     (legacy) Scrape MiLB game logs for batters from FanGraphs
Usage
     milb_batter_game_logs_fg(playerid, year)
Arguments
     playerid            The batter’s minor league ID from FanGraphs.
     year                The season for which game logs should be returned.
Value
     Returns a tibble of Minor League batter game logs.
   milb_pitcher_game_logs_fg
                               (legacy) Scrape MiLB game logs for pitchers from FanGraphs
Description
     (legacy) Scrape MiLB game logs for pitchers from FanGraphs
Usage
     milb_pitcher_game_logs_fg(playerid, year)
mlb                                                                                           81
Arguments
    playerid            The pitcher’s minor league ID from FanGraphs.com.
    year                The season for which game logs should be returned.
Value
    Returns a tibble of Minor League pitcher game logs.
  mlb                          MLB Functions Overview
Description
    mlb_batting_orders(): Retrieve batting orders for a given MLB game.
    mlb_draft(): Retrieve draft pick information by year.
    mlb_pbp(): Acquire pitch-by-pitch data for Major and Minor League games.
    mlb_game_info(): Retrieve additional game information for major and minor league games.
    mlb_game_pks(): Get MLB Game Info by Date and Level.
    mlb_schedule(): Find game_pk values for professional baseball games (major and minor leagues).
    mlb_probables(): Retrieve probable starters for a given MLB game.
Details
      Retrieve batting orders for a given MLB game:
        mlb_batting_orders(game_pk=566001)
      Retrieve draft pick information by year:
        mlb_draft(year= 2018)
      Acquire pitch-by-pitch data for Major and Minor League games:
        mlb_pbp(game_pk = 575156)
      Retrieve additional game information for major and minor league games:
        mlb_game_info(game_pk = 566001)
      Get MLB Game Info by Date and Level:
        mlb_game_pks("2019-04-29")
      Find game_pk values for professional baseball games (major and minor leagues):
        mlb_schedule(season = "2019")
      Retrieve probable starters for a given MLB game:
        mlb_probables(566001)
82                                                                           mlb_all_star_ballots
   mlb_all_star_ballots          Find MLB All-Star Ballots
Description
     Find MLB All-Star Ballots
Usage
     mlb_all_star_ballots(league_id = NULL, season = NULL)
Arguments
     league_id           League ID for league all-star ballot of interest.
     season              The season of the all-star ballot.
Value
     Returns a tibble with the following columns:
                               col_name                            types
                                player_id                          integer
                                full_name                          character
                                link                               character
                                first_name                         character
                                last_name                          character
                                primary_number                     character
                                birth_date                         character
                                current_age                        integer
                                birth_city                         character
                                birth_state_province               character
                                birth_country                      character
                                height                             character
                                weight                             integer
                                active                             logical
                                use_name                           character
                                middle_name                        character
                                boxscore_name                      character
                                nick_name                          character
                                gender                             character
                                is_player                          logical
                                is_verified                        logical
                                draft_year                         integer
                                mlb_debut_date                     character
                                name_first_last                    character
                                name_slug                          character
                                first_last_name                    character
mlb_all_star_final_vote                                                     83
                               last_first_name                    character
                               last_init_name                     character
                               init_last_name                     character
                               full_fml_name                      character
                               full_lfm_name                      character
                               strike_zone_top                    numeric
                               strike_zone_bottom                 numeric
                               pronunciation                      character
                               name_matrilineal                   character
                               name_title                         character
                               primary_position_code              character
                               primary_position_name              character
                               primary_position_type              character
                               primary_position_abbreviation      character
                               bat_side_code                      character
                               bat_side_description               character
                               pitch_hand_code                    character
                               pitch_hand_description             character
                               league_id                          numeric
                               season                             numeric
Examples
     try(mlb_all_star_ballots(league_id = 103, season = 2021))
  mlb_all_star_final_vote
                                Find MLB All-Star Final Vote
Description
    Find MLB All-Star Final Vote
Usage
    mlb_all_star_final_vote(league_id = NULL, season = NULL)
Arguments
    league_id           League ID for league all-star ballot of interest.
    season              The season of the all-star ballot.
Value
    Returns a tibble with the following columns:
84                                          mlb_all_star_final_vote
   col_name                       types
    player_id                     integer
    full_name                     character
    link                          character
    first_name                    character
    last_name                     character
    primary_number                character
    birth_date                    character
    current_age                   integer
    birth_city                    character
    birth_state_province          character
    birth_country                 character
    height                        character
    weight                        integer
    active                        logical
    use_name                      character
    middle_name                   character
    boxscore_name                 character
    nick_name                     character
    gender                        character
    is_player                     logical
    is_verified                   logical
    draft_year                    integer
    mlb_debut_date                character
    name_first_last               character
    name_slug                     character
    first_last_name               character
    last_first_name               character
    last_init_name                character
    init_last_name                character
    full_fml_name                 character
    full_lfm_name                 character
    strike_zone_top               numeric
    strike_zone_bottom            numeric
    pronunciation                 character
    name_matrilineal              character
    name_title                    character
    primary_position_code         character
    primary_position_name         character
    primary_position_type         character
    primary_position_abbreviation character
    bat_side_code                 character
    bat_side_description          character
    pitch_hand_code               character
    pitch_hand_description        character
    league_id                     numeric
    season                        numeric
mlb_all_star_write_ins                                                      85
Examples
      try(mlb_all_star_final_vote(league_id = 103, season = 2021))
  mlb_all_star_write_ins
                                Find MLB All-Star Write-ins
Description
    Find MLB All-Star Write-ins
Usage
    mlb_all_star_write_ins(league_id = NULL, season = NULL)
Arguments
    league_id           League ID for league all-star ballot of interest.
    season              The season of the all-star ballot.
Value
    Returns a tibble with the following columns:
                              col_name                            types
                               player_id                          integer
                               full_name                          character
                               link                               character
                               first_name                         character
                               last_name                          character
                               primary_number                     character
                               birth_date                         character
                               current_age                        integer
                               birth_city                         character
                               birth_state_province               character
                               birth_country                      character
                               height                             character
                               weight                             integer
                               active                             logical
                               use_name                           character
                               middle_name                        character
                               boxscore_name                      character
                               nick_name                          character
                               gender                             character
                               is_player                          logical
86                                                                  mlb_attendance
                            is_verified                   logical
                            draft_year                    integer
                            mlb_debut_date                character
                            name_first_last               character
                            name_slug                     character
                            first_last_name               character
                            last_first_name               character
                            last_init_name                character
                            init_last_name                character
                            full_fml_name                 character
                            full_lfm_name                 character
                            strike_zone_top               numeric
                            strike_zone_bottom            numeric
                            pronunciation                 character
                            name_matrilineal              character
                            name_title                    character
                            primary_position_code         character
                            primary_position_name         character
                            primary_position_type         character
                            primary_position_abbreviation character
                            bat_side_code                 character
                            bat_side_description          character
                            pitch_hand_code               character
                            pitch_hand_description        character
                            league_id                     numeric
                            season                        numeric
Examples
      try(mlb_all_star_write_ins(league_id = 103, season = 2021))
   mlb_attendance            MLB Attendance
Description
     MLB Attendance
Usage
     mlb_attendance(
       team_id = NULL,
       league_id = NULL,
       season = NULL,
mlb_attendance                                                                                      87
      date = NULL,
      league_list_id = NULL
    )
Arguments
    team_id             Return attendance information for a particular team_id(s).
    league_id           Return attendance information for a particular league_id(s). Format: ’103,104’
    season              Return attendance information for particular year(s).
    date                Return attendance information on a particular date. Format: MM/DD/YYYY
    league_list_id Unique league list identifier to return a directory of attendance for a specific
                        league list_id Valid values include:
                           •  milb_full
                           •  milb_short
                           •  milb_complex
                           •  milb_all
                           •  milb_all_nomex
                           •  milb_all_domestic
                           •  milb_noncomp
                           •  milb_noncomp_nomex
                           •  milb_domcomp
                           •  milb_intcomp
                           •  win_noabl
                           •  win_caribbean
                           •  win_all
                           •  abl
                           •  mlb
                           •  mlb_hist
                           •  mlb_milb
                           •  mlb_milb_hist
                           •  mlb_milb_win
                           •  baseball_all
Value
    Returns a tibble with the following columns
                            col_name                               types
                             openings_total                        integer
                             openings_total_away                   integer
                             openings_total_home                   integer
                             openings_total_lost                   integer
                             games_total                           integer
                             games_away_total                      integer
                             games_home_total                      integer
88                                                                          mlb_award
                         year                               character
                         attendance_average_away            integer
                         attendance_average_home            integer
                         attendance_average_ytd             integer
                         attendance_high                    integer
                         attendance_high_date               character
                         attendance_low                     integer
                         attendance_low_date                character
                         attendance_opening_average         integer
                         attendance_total                   integer
                         attendance_total_away              integer
                         attendance_total_home              integer
                         attendance_high_game_game_pk       integer
                         attendance_high_game_link          character
                         attendance_high_game_day_night     character
                         attendance_high_game_content_link  character
                         attendance_low_game_game_pk        integer
                         attendance_low_game_link           character
                         attendance_low_game_day_night      character
                         attendance_low_game_content_link   character
                         game_type_id                       character
                         game_type_description              character
                         team_id                            integer
                         team_name                          character
                         team_link                          character
Examples
       try(mlb_attendance(team_id = 109, season = 2021))
   mlb_award                 MLB All-Star, Awards, Home Run Derby Functions
Description
     mlb_all_star_ballots(): Find MLB All-Star Ballots.
     mlb_all_star_final_vote(): Find MLB All-Star Final Vote.
     mlb_all_star_write_ins(): Find MLB All-Star Write-ins.
     mlb_awards(): Find MLB Awards.
     mlb_awards_recipient(): Find MLB Award Recipients.
     mlb_homerun_derby(): Retrieve MLB Home Run Derby Data.
     mlb_homerun_derby_bracket(): Retrieve MLB Home Run Derby Bracket.
     mlb_homerun_derby_players(): Retrieve MLB Home Run Derby Players.
mlb_awards                                                            89
Details
      Find MLB All-Star Ballots:
        try(mlb_all_star_ballots(league_id = 103, season = 2021))
      Find MLB All-Star Final Vote:
        try(mlb_all_star_final_vote(league_id = 103, season = 2021))
      Find MLB All-Star Write-ins:
        try(mlb_all_star_write_ins(league_id = 103, season = 2021))
      Find MLB Awards:
        try(mlb_awards())
      Find MLB Award Recipients:
        try(mlb_awards_recipient(award_id = 'MLBHOF', season = 2020))
      Retrieve MLB Home Run Derby Data:
        try(mlb_homerun_derby(game_pk = 511101))
      Retrieve MLB Home Run Derby Bracket:
         try(mlb_homerun_derby_bracket(game_pk = 511101))
      Retrieve MLB Home Run Derby Players:
         try(mlb_homerun_derby_players(game_pk = 511101))
  mlb_awards               MLB Awards
Description
    MLB Awards
Usage
    mlb_awards()
90                                                                                  mlb_awards_recipient
Value
     Returns a tibble with the following columns
                                      col_name               types
                                       award_id              character
                                       award_name            character
                                       award_description     character
                                       sort_order            integer
                                       notes                 character
                                       sport_id              integer
                                       sport_link            character
                                       league_id             integer
                                       league_link           character
Examples
       try(mlb_awards())
   mlb_awards_recipient         MLB Award Recipients
Description
     MLB Award Recipients
Usage
     mlb_awards_recipient(
       award_id = NULL,
       sport_id = NULL,
       league_id = NULL,
       season = NULL
     )
Arguments
     award_id            award_id to return a directory of players for a given award.
     sport_id            sport_id to return a directory of players for a given aware in a specific sport.
     league_id           league_id(s) to return a directory of players for a given award in a specific
                         league. Format ’103,104’
     season              Year(s) to return a directory of players for a given award in a given season.
Value
     Returns a tibble with the following columns
mlb_baseball_stats                                                          91
                          col_name                                types
                           award_id                               character
                           award_name                             character
                           date                                   character
                           season                                 character
                           votes                                  integer
                           notes                                  character
                           player_id                              integer
                           player_link                            character
                           player_name_first_last                 character
                           player_primary_position_code           character
                           player_primary_position_name           character
                           player_primary_position_type           character
                           player_primary_position_abbreviation   character
                           team_id                                integer
                           team_link                              character
Examples
      try(mlb_awards_recipient(award_id = 'MLBHOF', season = 2020))
  mlb_baseball_stats            MLB Baseball Stats
Description
    MLB Baseball Stats
Usage
    mlb_baseball_stats()
Value
    Returns a tibble with the following columns:
                                    col_name            types
                                     stat_name          character
                                     stat_lookup_param  character
                                     is_counting        logical
                                     stat_label         character
                                     stat_group         character
92                                                                                       mlb_batting_orders
Examples
       try(mlb_baseball_stats())
   mlb_batting_orders            Retrieve batting orders for a given MLB game
Description
     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_name                   types
                                     id                        integer
                                     fullName                  character
                                     abbreviation              character
                                     batting_order             character
                                     batting_position_num      character
                                     team                      character
                                     teamName                  character
                                     teamID                    integer
Examples
       try(mlb_batting_orders(game_pk=566001))
mlb_divisions                                                                93
  mlb_conferences              View all PCL conferences
Description
    View all PCL conferences
Usage
    mlb_conferences(conference_id = NULL, season = NULL)
Arguments
    conference_id       Conference ID to return information for.
    season              Year to return to return conference information for.
Value
    Returns a tibble with the following columns
                                  col_name                    types
                                   conference_id              integer
                                   conference_name            character
                                   link                       character
                                   conference_abbreviation    character
                                   has_wildcard               logical
                                   name_short                 character
                                   league_id                  integer
                                   league_link                character
                                   sport_id                   integer
                                   sport_link                 character
Examples
      try(mlb_conferences())
      try(mlb_conferences(conference_id =         301, season = 2020))
  mlb_divisions                MLB Divisions
Description
    MLB Divisions
94                                                                                      mlb_draft
Usage
     mlb_divisions(division_id = NULL, league_id = NULL, sport_id = NULL)
Arguments
     division_id         Return division(s) data for a specific division
     league_id           Return division(s) data for all divisions in a specific league
     sport_id            Return division(s) for all divisions in a specific sport.
Value
     Returns a tibble with the following columns
                                    col_name                   types
                                     division_id               integer
                                     division_name             character
                                     season                    character
                                     division_name_short       character
                                     division_link             character
                                     division_abbreviation     character
                                     has_wildcard              logical
                                     sort_order                integer
                                     num_playoff_teams         integer
                                     active                    logical
                                     league_id                 integer
                                     league_link               character
                                     sport_id                  integer
                                     sport_link                character
Examples
       try(mlb_divisions(sport_id = 1))
   mlb_draft                    Retrieve draft pick information by year
Description
     Retrieve draft pick information by year
Usage
     mlb_draft(year)
mlb_draft                                                                                        95
Arguments
    year                The year for which to return data
Value
    Returns a tibble with information for every draft pick in every round for the year requested
                          col_name                                   types
                           bis_player_id                             integer
                           pick_round                                character
                           pick_number                               integer
                           round_pick_number                         integer
                           rank                                      integer
                           pick_value                                character
                           signing_bonus                             character
                           scouting_report                           character
                           blurb                                     character
                           headshot_link                             character
                           is_drafted                                logical
                           is_pass                                   logical
                           year                                      character
                           home_city                                 character
                           home_state                                character
                           home_country                              character
                           school_name                               character
                           school_school_class                       character
                           school_country                            character
                           school_state                              character
                           person_id                                 integer
                           person_full_name                          character
                           person_link                               character
                           person_first_name                         character
                           person_last_name                          character
                           person_primary_number                     character
                           person_birth_date                         character
                           person_current_age                        integer
                           person_birth_city                         character
                           person_birth_state_province               character
                           person_birth_country                      character
                           person_height                             character
                           person_weight                             integer
                           person_active                             logical
                           person_use_name                           character
                           person_middle_name                        character
                           person_boxscore_name                      character
                           person_gender                             character
                           person_is_player                          logical
                           person_is_verified                        logical
96                                                                            mlb_draft_latest
                           person_draft_year                        integer
                           person_name_first_last                   character
                           person_name_slug                         character
                           person_first_last_name                   character
                           person_last_first_name                   character
                           person_last_init_name                    character
                           person_init_last_name                    character
                           person_full_fml_name                     character
                           person_full_lfm_name                     character
                           person_strike_zone_top                   numeric
                           person_strike_zone_bottom                numeric
                           person_pronunciation                     character
                           person_name_title                        character
                           person_mlb_debut_date                    character
                           person_name_matrilineal                  character
                           person_primary_position_code             character
                           person_primary_position_name             character
                           person_primary_position_type             character
                           person_primary_position_abbreviation     character
                           person_bat_side_code                     character
                           person_bat_side_description              character
                           person_pitch_hand_code                   character
                           person_pitch_hand_description            character
                           team_id                                  integer
                           team_name                                character
                           team_link                                character
                           team_all_star_status                     character
                           team_spring_league_id                    integer
                           team_spring_league_name                  character
                           team_spring_league_link                  character
                           team_spring_league_abbreviation          character
                           draft_type_code                          character
                           draft_type_description                   character
Examples
      try(mlb_draft(year = 2020))
   mlb_draft_latest             Retrieve latest draft information by year
Description
     Retrieve latest draft information by year
mlb_draft_latest                                                                 97
Usage
    mlb_draft_latest(year)
Arguments
    year                The year for which to return data
Value
    Returns a tibble with the latest draft information for the year requested:
                          col_name                                     types
                           bis_player_id                               integer
                           pick_round                                  character
                           pick_number                                 integer
                           round_pick_number                           integer
                           rank                                        integer
                           pick_value                                  character
                           signing_bonus                               character
                           home_city                                   character
                           home_state                                  character
                           home_country                                character
                           scouting_report                             character
                           school_name                                 character
                           school_school_class                         character
                           school_country                              character
                           school_state                                character
                           blurb                                       character
                           headshot_link                               character
                           person_id                                   integer
                           person_full_name                            character
                           person_link                                 character
                           person_first_name                           character
                           person_last_name                            character
                           person_primary_number                       character
                           person_birth_date                           character
                           person_current_age                          integer
                           person_birth_city                           character
                           person_birth_state_province                 character
                           person_birth_country                        character
                           person_height                               character
                           person_weight                               integer
                           person_active                               logical
                           person_primary_position_code                character
                           person_primary_position_name                character
                           person_primary_position_type                character
                           person_primary_position_abbreviation        character
                           person_use_name                             character
                           person_middle_name                          character
98                                         mlb_draft_latest
   person_boxscore_name          character
   person_gender                 character
   person_is_player              logical
   person_is_verified            logical
   person_draft_year             integer
   person_bat_side_code          character
   person_bat_side_description   character
   person_pitch_hand_code        character
   person_pitch_hand_description character
   person_name_first_last        character
   person_name_slug              character
   person_first_last_name        character
   person_last_first_name        character
   person_last_init_name         character
   person_init_last_name         character
   person_full_fml_name          character
   person_full_lfm_name          character
   person_strike_zone_top        numeric
   person_strike_zone_bottom     numeric
   team_id                       integer
   team_name                     character
   team_link                     character
   team_season                   integer
   team_venue_id                 integer
   team_venue_name               character
   team_venue_link               character
   team_spring_venue_id          integer
   team_spring_venue_link        character
   team_team_code                character
   team_file_code                character
   team_abbreviation             character
   team_team_name                character
   team_location_name            character
   team_first_year_of_play       character
   team_league_id                integer
   team_league_name              character
   team_league_link              character
   team_division_id              integer
   team_division_name            character
   team_division_link            character
   team_sport_id                 integer
   team_sport_link               character
   team_sport_name               character
   team_short_name               character
   team_franchise_name           character
   team_club_name                character
   team_spring_league_id         integer
   team_spring_league_name       character
mlb_draft_prospects                                                                    99
                           team_spring_league_link                   character
                           team_spring_league_abbreviation           character
                           team_all_star_status                      character
                           team_active                               logical
                           draft_type_code                           character
                           draft_type_description                    character
                           is_drafted                                logical
                           is_pass                                   logical
                           year                                      character
Examples
     try(mlb_draft_latest(year = 2020))
  mlb_draft_prospects           Retrieve draft prospect information by year
Description
    Retrieve draft prospect information by year
Usage
    mlb_draft_prospects(year)
Arguments
    year                The year for which to return data
Value
    Returns a tibble with information for every draft prospect for the year requested:
                          col_name                                   types
                           bis_player_id                             integer
                           pick_round                                character
                           pick_number                               integer
                           rank                                      integer
                           scouting_report                           character
                           blurb                                     character
                           headshot_link                             character
                           is_drafted                                logical
                           year                                      character
                           home_city                                 character
                           home_state                                character
100                                        mlb_draft_prospects
    home_country                 character
    school_name                  character
    school_school_class          character
    school_country               character
    school_state                 character
    person_id                    integer
    person_full_name             character
    person_link                  character
    person_first_name            character
    person_last_name             character
    person_birth_date            character
    person_current_age           integer
    person_birth_city            character
    person_birth_state_province  character
    person_birth_country         character
    person_height                character
    person_weight                integer
    person_active                logical
    person_use_name              character
    person_middle_name           character
    person_boxscore_name         character
    person_gender                character
    person_is_player             logical
    person_is_verified           logical
    person_draft_year            integer
    person_name_first_last       character
    person_name_slug             character
    person_first_last_name       character
    person_last_first_name       character
    person_last_init_name        character
    person_init_last_name        character
    person_full_fml_name         character
    person_full_lfm_name         character
    person_strike_zone_top       numeric
    person_strike_zone_bottom    numeric
    person_primary_number        character
    person_pronunciation         character
    person_name_title            character
    person_mlb_debut_date        character
    person_name_matrilineal      character
    person_nick_name             character
    person_death_date            character
    person_death_city            character
    person_death_state_province  character
    person_death_country         character
    person_primary_position_code character
    person_primary_position_name character
    person_primary_position_type character
mlb_draft_prospects                                                   101
                       person_primary_position_abbreviation character
                       person_bat_side_code                 character
                       person_bat_side_description          character
                       person_pitch_hand_code               character
                       person_pitch_hand_description        character
                       team_id                              integer
                       team_name                            character
                       team_link                            character
                       team_season                          integer
                       team_team_code                       character
                       team_file_code                       character
                       team_abbreviation                    character
                       team_team_name                       character
                       team_location_name                   character
                       team_first_year_of_play              character
                       team_short_name                      character
                       team_franchise_name                  character
                       team_club_name                       character
                       team_all_star_status                 character
                       team_active                          logical
                       team_venue_id                        integer
                       team_venue_name                      character
                       team_venue_link                      character
                       team_spring_venue_id                 integer
                       team_spring_venue_link               character
                       team_league_id                       integer
                       team_league_name                     character
                       team_league_link                     character
                       team_division_id                     integer
                       team_division_name                   character
                       team_division_link                   character
                       team_sport_id                        integer
                       team_sport_link                      character
                       team_sport_name                      character
                       team_spring_league_id                integer
                       team_spring_league_name              character
                       team_spring_league_link              character
                       team_spring_league_abbreviation      character
                       draft_type_code                      character
                       draft_type_description               character
Examples
     try(mlb_draft_prospects(year = 2020))
102                                                                  mlb_fielder_detail_types
  mlb_event_types              MLB Event Types
Description
    MLB Event Types
Usage
    mlb_event_types()
Value
    Returns a tibble with the following columns
                                   col_name                types
                                    plate_appearance       logical
                                    hit                    logical
                                    event_code             character
                                    base_running_event     logical
                                    event_description      character
Examples
      try(mlb_event_types())
  mlb_fielder_detail_types
                               MLB Fielder Detail Types
Description
    MLB Fielder Detail Types
Usage
    mlb_fielder_detail_types()
Value
    Returns a tibble with the following columns
                                         col_name     types
mlb_game_changes                                                                    103
                                           stat_name    character
                                           code         character
                                           names        character
                                           chance       logical
                                           error        logical
Examples
      try(mlb_fielder_detail_types())
  mlb_game_changes              Acquire time codes for Major and Minor League games
Description
    Acquire time codes for Major and Minor League games
Usage
    mlb_game_changes(updated_since, sport_id)
Arguments
    updated_since       Updated since date time
    sport_id            Return division(s) for all divisions in a specific sport.
Value
    Returns a tibble that includes time codes from the game_pk requested
                            col_name                                 types
                             date                                    character
                             total_items                             integer
                             total_events                            integer
                             total_games                             integer
                             total_games_in_progress                 integer
                             game_pk                                 integer
                             link                                    character
                             game_type                               character
                             season                                  character
                             game_date                               character
                             official_date                           character
                             is_tie                                  logical
                             game_number                             integer
104                                           mlb_game_changes
    public_facing                   logical
    double_header                   character
    gameday_type                    character
    tiebreaker                      character
    calendar_event_id               character
    season_display                  character
    day_night                       character
    description                     character
    scheduled_innings               integer
    reverse_home_away_status        logical
    inning_break_length             integer
    games_in_series                 integer
    series_game_number              integer
    series_description              character
    record_source                   character
    if_necessary                    character
    if_necessary_description        character
    status_abstract_game_state      character
    status_coded_game_state         character
    status_detailed_state           character
    status_status_code              character
    status_start_time_tbd           logical
    status_abstract_game_code       character
    teams_away_score                integer
    teams_away_is_winner            logical
    teams_away_split_squad          logical
    teams_away_series_number        integer
    teams_away_league_record_wins   integer
    teams_away_league_record_losses integer
    teams_away_league_record_pct    character
    teams_away_team_id              integer
    teams_away_team_name            character
    teams_away_team_link            character
    teams_home_score                integer
    teams_home_is_winner            logical
    teams_home_split_squad          logical
    teams_home_series_number        integer
    teams_home_league_record_wins   integer
    teams_home_league_record_losses integer
    teams_home_league_record_pct    character
    teams_home_team_id              integer
    teams_home_team_name            character
    teams_home_team_link            character
    venue_id                        integer
    venue_name                      character
    venue_link                      character
    content_link                    character
    status_reason                   character
mlb_game_content                                                                         105
                            rescheduled_from                      character
                            rescheduled_from_date                 character
                            resumed_from                          character
                            resumed_from_date                     character
                            events                                list
Examples
      try(mlb_game_changes(updated_since = "2021-08-10T19:08:24.000004Z", sport_id = 1))
  mlb_game_content             Retrieve additional game content for major and minor league
                               games
Description
    Retrieve additional game content for major and minor league games
Usage
    mlb_game_content(game_pk)
Arguments
    game_pk             The unique game_pk identifier for the game
Value
    Returns a tibble of game content data with the following columns:
                                  col_name                 types
                                   title                   character
                                   epg_id                  integer
                                   content_id              character
                                   media_id                character
                                   media_state             character
                                   media_feed_type         character
                                   media_feed_sub_type     character
                                   call_letters            character
                                   fox_auth_required       logical
                                   tbs_auth_required       logical
                                   espn_auth_required      logical
                                   fs1auth_required        logical
                                   mlbn_auth_required      logical
                                   free_game               logical
106                                                                        mlb_game_context_metrics
                                    type                   character
                                    description            character
                                    rendition_name         character
                                    language               character
Examples
      try(mlb_game_content(game_pk = 566001))
  mlb_game_context_metrics
                                Acquire game context metrics for Major and Minor League games
Description
    Acquire game context metrics for Major and Minor League games
Usage
    mlb_game_context_metrics(game_pk, timecode)
Arguments
    game_pk             The game_pk for the game requested
    timecode            The time code for the MLB game (format: MMDDYYYY_HHMMSS)
Value
    Returns a tibble that includes time codes from the game_pk requested
                        col_name                                     types
                         game_pk                                     integer
                         link                                        character
                         game_type                                   character
                         season                                      character
                         game_date                                   character
                         official_date                               character
                         status_abstract_game_state                  character
                         status_coded_game_state                     character
                         status_detailed_state                       character
                         status_status_code                          character
                         status_start_time_tbd                       logical
                         status_abstract_game_code                   character
                         teams_away_league_record_wins               integer
mlb_game_context_metrics                                             107
                     teams_away_league_record_losses       integer
                     teams_away_league_record_pct          character
                     teams_away_score                      integer
                     teams_away_team_id                    integer
                     teams_away_team_name                  character
                     teams_away_team_link                  character
                     teams_away_is_winner                  logical
                     teams_away_probable_pitcher_id        integer
                     teams_away_probable_pitcher_full_name character
                     teams_away_probable_pitcher_link      character
                     teams_away_split_squad                logical
                     teams_away_series_number              integer
                     teams_home_league_record_wins         integer
                     teams_home_league_record_losses       integer
                     teams_home_league_record_pct          character
                     teams_home_score                      integer
                     teams_home_team_id                    integer
                     teams_home_team_name                  character
                     teams_home_team_link                  character
                     teams_home_is_winner                  logical
                     teams_home_probable_pitcher_id        integer
                     teams_home_probable_pitcher_full_name character
                     teams_home_probable_pitcher_link      character
                     teams_home_split_squad                logical
                     teams_home_series_number              integer
                     venue_id                              integer
                     venue_name                            character
                     venue_link                            character
                     link_1                                character
                     is_tie                                logical
                     game_number                           integer
                     public_facing                         logical
                     double_header                         character
                     gameday_type                          character
                     tiebreaker                            character
                     calendar_event_id                     character
                     season_display                        character
                     day_night                             character
                     scheduled_innings                     integer
                     reverse_home_away_status              logical
                     inning_break_length                   integer
                     games_in_series                       integer
                     series_game_number                    integer
                     series_description                    character
                     record_source                         character
                     if_necessary                          character
                     if_necessary_description              character
                     game_id                               character
108                                                                                      mlb_game_info
                          home_win_probability                        numeric
                          away_win_probability                        numeric
Examples
      try(mlb_game_context_metrics(game_pk = 531060, timecode = "20180803_182458"))
  mlb_game_info                 Retrieve additional game information for major and minor league
                                games
Description
    Retrieve additional game information for major and minor league games
Usage
    mlb_game_info(game_pk)
Arguments
    game_pk             The unique game_pk identifier for the game
Value
    Returns a tibble that includes supplemental information, such as weather, official scorer, attendance,
    etc., for the game_pk provided
                                     col_name             types
                                      game_date           character
                                      game_pk             numeric
                                      venue_name          character
                                      venue_id            integer
                                      temperature         character
                                      other_weather       character
                                      wind                character
                                      attendance          character
                                      start_time          character
                                      elapsed_time        character
                                      game_id             character
                                      game_type           character
                                      home_sport_code     character
                                      official_scorer     character
                                      date                character
                                      status_ind          character
mlb_game_linescore                                                                       109
                                     home_league_id      integer
                                     gameday_sw          character
Examples
      try(mlb_game_info(game_pk = 566001))
  mlb_game_linescore           Retrieve game linescores for major and minor league games
Description
    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_name                                        types
                      game_pk                                        numeric
                      home_team_id                                   character
                      home_team_name                                 character
                      away_team_id                                   character
                      away_team_name                                 character
                      num                                            integer
                      ordinal_num                                    character
                      home_runs                                      integer
                      home_hits                                      integer
                      home_errors                                    integer
                      home_left_on_base                              integer
                      away_runs                                      integer
                      away_hits                                      integer
                      away_errors                                    integer
                      away_left_on_base                              integer
                      home_team_link                                 character
                      home_team_season                               character
                      home_team_venue_id                             character
110                                                     mlb_game_linescore
    home_team_venue_name                      character
    home_team_venue_link                      character
    home_team_team_code                       character
    home_team_file_code                       character
    home_team_abbreviation                    character
    home_team_team_name                       character
    home_team_location_name                   character
    home_team_first_year_of_play              character
    home_team_league_id                       character
    home_team_league_name                     character
    home_team_league_link                     character
    home_team_division_id                     character
    home_team_division_name                   character
    home_team_division_link                   character
    home_team_sport_id                        character
    home_team_sport_link                      character
    home_team_sport_name                      character
    home_team_short_name                      character
    home_team_record_games_played             character
    home_team_record_wild_card_games_back     character
    home_team_record_league_games_back        character
    home_team_record_spring_league_games_back character
    home_team_record_sport_games_back         character
    home_team_record_division_games_back      character
    home_team_record_conference_games_back    character
    home_team_record_league_record_wins       character
    home_team_record_league_record_losses     character
    home_team_record_league_record_pct        character
    home_team_record_division_leader          character
    home_team_record_wins                     character
    home_team_record_losses                   character
    home_team_record_winning_percentage       character
    home_team_franchise_name                  character
    home_team_club_name                       character
    home_team_all_star_status                 character
    home_team_active                          character
    away_team_link                            character
    away_team_season                          character
    away_team_venue_id                        character
    away_team_venue_name                      character
    away_team_venue_link                      character
    away_team_team_code                       character
    away_team_file_code                       character
    away_team_abbreviation                    character
    away_team_team_name                       character
    away_team_location_name                   character
    away_team_first_year_of_play              character
    away_team_league_id                       character
mlb_game_pace                                                                    111
                   away_team_league_name                         character
                   away_team_league_link                         character
                   away_team_division_id                         character
                   away_team_division_name                       character
                   away_team_division_link                       character
                   away_team_sport_id                            character
                   away_team_sport_link                          character
                   away_team_sport_name                          character
                   away_team_short_name                          character
                   away_team_record_games_played                 character
                   away_team_record_wild_card_games_back         character
                   away_team_record_league_games_back            character
                   away_team_record_spring_league_games_back     character
                   away_team_record_sport_games_back             character
                   away_team_record_division_games_back          character
                   away_team_record_conference_games_back        character
                   away_team_record_league_record_wins           character
                   away_team_record_league_record_losses         character
                   away_team_record_league_record_pct            character
                   away_team_record_division_leader              character
                   away_team_record_wins                         character
                   away_team_record_losses                       character
                   away_team_record_winning_percentage           character
                   away_team_franchise_name                      character
                   away_team_club_name                           character
                   away_team_all_star_status                     character
                   away_team_active                              character
Examples
      try(mlb_game_linescore(game_pk = 566001))
  mlb_game_pace            Retrieve game pace metrics for major and minor league
Description
    Retrieve game pace metrics for major and minor league
Usage
    mlb_game_pace(
      season,
      league_ids = NULL,
112                                                                                     mlb_game_pace
      sport_ids = NULL,
      team_ids = NULL,
      game_type = NULL,
      venue_ids = NULL,
      org_type = NULL,
      start_date = NULL,
      end_date = NULL
    )
Arguments
    season               Year for which to return information (Required).
    league_ids           The league_id(s) for which to return information.
    sport_ids            The sport_id(s) for which to return information.
    team_ids             The team_id(s) for which to return information.
    game_type            The game_type for which to return information.
    venue_ids            Venue directorial information based venue_id.
    org_type             pace of game metrics based on team (’T’), league (’L’) or sport(’S’)
    start_date           Date of first game for which you want data. Format must be in MM/DD/YYYY
                         format.
    end_date             Date of last game for which you want data. Format must be in MM/DD/YYYY
                         format.
Value
    Returns a tibble with the following columns
                  col_name                                                  types
                   hits_per9inn                                             numeric
                   runs_per9inn                                             numeric
                   pitches_per9inn                                          numeric
                   plate_appearances_per9inn                                numeric
                   hits_per_game                                            numeric
                   runs_per_game                                            numeric
                   innings_played_per_game                                  numeric
                   pitches_per_game                                         numeric
                   pitchers_per_game                                        numeric
                   plate_appearances_per_game                               numeric
                   total_game_time                                          character
                   total_innings_played                                     integer
                   total_hits                                               integer
                   total_runs                                               integer
                   total_plate_appearances                                  integer
                   total_pitchers                                           integer
                   total_pitches                                            integer
                   total_games                                              integer
                   total7inn_games                                          integer
mlb_game_pks                                                                                 113
                total9inn_games                                        integer
                total_extra_inn_games                                  integer
                time_per_game                                          character
                time_per_pitch                                         character
                time_per_hit                                           character
                time_per_run                                           character
                time_per_plate_appearance                              character
                time_per9inn                                           character
                time_per77plate_appearances                            character
                total_extra_inn_time                                   character
                time_per7inn_game                                      character
                time_per7inn_game_without_extra_inn                    character
                total7inn_games_scheduled                              integer
                total7inn_games_without_extra_inn                      integer
                total9inn_games_completed_early                        integer
                total9inn_games_without_extra_inn                      integer
                total9inn_games_scheduled                              integer
                hits_per_run                                           numeric
                pitches_per_pitcher                                    numeric
                season                                                 character
                sport_id                                               integer
                sport_code                                             character
                sport_link                                             character
                pr_portal_calculated_fields_total7inn_games            integer
                pr_portal_calculated_fields_total9inn_games            integer
                pr_portal_calculated_fields_total_extra_inn_games      integer
                pr_portal_calculated_fields_time_per7inn_game          character
                pr_portal_calculated_fields_time_per9inn_game          character
                pr_portal_calculated_fields_time_per_extra_inn_game    character
Examples
      try(mlb_game_pace(season = 2021, start_date = "09/14/2021", end_date = "09/16/2021"))
  mlb_game_pks               Get MLB Game Info by Date and Level
Description
    Find game_pk values for professional baseball games (major and minor leagues) via the MLB api
    https://www.mlb.com/
Usage
    mlb_game_pks(date, level_ids = c(1))
114                                                                                    mlb_game_pks
Arguments
    date                The date for which you want to find game_pk values for MLB games
    level_ids           A numeric vector with ids for each level where game_pks are desired. See below
                        for a reference of level ids.
Details
    Level IDs:
    The following IDs can be passed to the level_ids argument:
    1 = MLB 11 = Triple-A 12 = Doubl-A 13 = Class A Advanced 14 = Class A 15 = Class A Short
    Season 5442 = Rookie Advanced 16 = Rookie 17 = Winter League
Value
    Returns a tibble that includes game_pk values and additional information for games scheduled or
    played with the following columns:
                             col_name                             types
                              game_pk                             integer
                              link                                character
                              gameType                            character
                              season                              character
                              gameDate                            character
                              officialDate                        character
                              isTie                               logical
                              gameNumber                          integer
                              publicFacing                        logical
                              doubleHeader                        character
                              gamedayType                         character
                              tiebreaker                          character
                              calendarEventID                     character
                              seasonDisplay                       character
                              dayNight                            character
                              scheduledInnings                    integer
                              reverseHomeAwayStatus               logical
                              inningBreakLength                   integer
                              gamesInSeries                       integer
                              seriesGameNumber                    integer
                              seriesDescription                   character
                              recordSource                        character
                              ifNecessary                         character
                              ifNecessaryDescription              character
                              status.abstractGameState            character
                              status.codedGameState               character
                              status.detailedState                character
                              status.statusCode                   character
                              status.startTimeTBD                 logical
                              status.abstractGameCode             character
mlb_game_status_codes                                                    115
                             teams.away.score                  integer
                             teams.away.isWinner               logical
                             teams.away.splitSquad             logical
                             teams.away.seriesNumber           integer
                             teams.away.leagueRecord.wins      integer
                             teams.away.leagueRecord.losses    integer
                             teams.away.leagueRecord.pct       character
                             teams.away.team.id                integer
                             teams.away.team.name              character
                             teams.away.team.link              character
                             teams.home.score                  integer
                             teams.home.isWinner               logical
                             teams.home.splitSquad             logical
                             teams.home.seriesNumber           integer
                             teams.home.leagueRecord.wins      integer
                             teams.home.leagueRecord.losses    integer
                             teams.home.leagueRecord.pct       character
                             teams.home.team.id                integer
                             teams.home.team.name              character
                             teams.home.team.link              character
                             venue.id                          integer
                             venue.name                        character
                             venue.link                        character
                             content.link                      character
Examples
      try(mlb_game_pks("2019-04-29"))
  mlb_game_status_codes MLB Game Status Codes
Description
    MLB Game Status Codes
Usage
    mlb_game_status_codes()
Value
    Returns a tibble with the following columns
                                   col_name              types
116                                                                             mlb_game_types
                                     abstract_game_state  character
                                     coded_game_state     character
                                     detailed_state       character
                                     status_code          character
                                     reason               character
                                     abstract_game_code   character
Examples
      try(mlb_game_status_codes())
  mlb_game_timecodes            Acquire time codes for Major and Minor League games
Description
    Acquire time codes for Major and Minor League games
Usage
    mlb_game_timecodes(game_pk)
Arguments
    game_pk             The game_pk for the game requested
Value
    Returns a tibble that includes time codes from the game_pk requested
                           col_name                                 types
                            timecodes (MMDDYYYY_HHMMSS)             numeric
Examples
      try(mlb_game_timecodes(game_pk = 632970))
  mlb_game_types                MLB Game Types
mlb_game_wp                                                                              117
Description
    MLB Game Types
Usage
    mlb_game_types()
Value
    Returns a tibble with the following columns
                                  col_name                 types
                                   game_type_id            character
                                   game_type_description   character
Examples
      try(mlb_game_types())
  mlb_game_wp                   Acquire win probability for Major and Minor League games
Description
    Acquire win probability for Major and Minor League games
Usage
    mlb_game_wp(game_pk, timecode = NULL)
Arguments
    game_pk             The game_pk for the game requested
    timecode            The time code for the MLB game (format: MMDDYYYY_HHMMSS)
Value
    Returns a tibble that includes time codes from the game_pk requested
                            col_name                              types
                             home_team_win_probability            numeric
                             away_team_win_probability            numeric
                             home_team_win_probability_added      numeric
                             at_bat_index                         integer
                             leverage_index                       numeric
118                                                                                   mlb_high_low_stats
Examples
       try(mlb_game_wp(game_pk = 531060))
   mlb_high_low_stats          Acquire high/low stats for Major and Minor Leagues
Description
     Acquire high/low stats for Major and Minor Leagues
Usage
     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_name                      stat_lookup_param          is_counting     stat_label                  stat_groups
  at_bats                       atBats                     TRUE            At bats                     hitting , pitching
  total_plate_appearances       plateAppearances           TRUE            Total plate appearances     hitting
  runs                          runs                       TRUE            Runs                        hitting
  runs_batted_in                rbi                        TRUE            Runs batted in              hitting
  home_team_runs                runs                       TRUE            Home team runs              hitting
  away_team_runs                runs                       TRUE            Away team runs              hitting
  hits                          hits                       TRUE            Hits                        hitting
mlb_high_low_stats                                                                            119
 hits_risp                  hitsRisp                   TRUE          Hits risp                 hitting
 home_team_hits             hits                       TRUE          Home team hits            hitting
 away_team_hits             hits                       TRUE          Away team hits            hitting
 total_bases                totalBases                 TRUE          Total bases               hitting , pitching
 doubles                    doubles                    TRUE          Doubles                   hitting , pitching
 triples                    triples                    TRUE          Triples                   hitting
 home_runs                  homeRuns                   TRUE          Home runs                 hitting , pitching
 extra_base_hits            extraBaseHits              TRUE          Extra base hits           hitting
 walks                      baseOnBalls                TRUE          Walks                     hitting , pitching
 strikeouts                 strikeouts                 TRUE          Strikeouts                hitting , pitching
 stolen_bases               stolenBases                TRUE          Stolen bases              hitting
 caught_stealing            caughtStealing             TRUE          Caught stealing           hitting , pitching, fielding
 sacrifice_flies            sacFlies                   TRUE          Sacrifice flies           hitting
 sacrifice_bunts            sacBunts                   TRUE          Sacrifice bunts           hitting
 hit_by_pitches             hitByPitch                 TRUE          Hit by pitches            hitting , pitching
 left_on_base               leftOnBase                 TRUE          Left on base              hitting
 ground_into_double_plays   groundIntoDoublePlay       TRUE          Ground into double plays  hitting , pitching
 strikes                    strikes                    TRUE          Strikes                   pitching
 pitches                    pitchesThrown              TRUE          Pitches                   pitching
 balks                      balks                      TRUE          Balks                     pitching
 innings_pitched            inningsPitched             TRUE          Innings pitched           pitching
 errors                     errors                     TRUE          Errors                    fielding
 home_team_errors           errors                     TRUE          Home team errors          fielding
 away_team_errors           errors                     TRUE          Away team errors          fielding
 chances                    chances                    TRUE          Chances                   fielding
 put_outs                   putOuts                    TRUE          Put outs                  fielding
 assists                    assists                    TRUE          Assists                   fielding
 double_plays               doublePlays                TRUE          Double plays              fielding
 attendance                 attendance                 TRUE          Attendance                game
 game_time                  gameDuration               TRUE          Game time                 game
 delay_time                 gameDuration               TRUE          Delay time                game
 longest                    gameDuration               TRUE          Longest                   game
 shortest                   gameDuration               TRUE          Shortest                  game
 inning                     innings                    TRUE          Inning                    game
 win_streak                 winStreak                  TRUE          Win streak                streak
 loss_streak                lossStreak                 TRUE          Loss streak               streak
    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
120                                                                    mlb_high_low_stats
                                                 fielding
                                                 catching
                                                 running
                                                 game
                                                 team
                                                 streak
    limit               Number of records as the limit of the return.
Value
    Returns a tibble with the following columns
                                  col_name                   types
                                   total_splits              integer
                                   season                    integer
                                   date                      character
                                   is_home                   logical
                                   rank                      integer
                                   game_innings              integer
                                   stat_at_bats              integer
                                   team_id                   integer
                                   team_name                 character
                                   team_link                 character
                                   opponent_id               integer
                                   opponent_name             character
                                   opponent_link             character
                                   game_pk                   integer
                                   game_link                 character
                                   game_number               integer
                                   game_content_link         character
                                   home_team_id              integer
                                   home_team_name            character
                                   home_team_link            character
                                   away_team_id              integer
                                   away_team_name            character
                                   away_team_link            character
                                   combined_stats            logical
                                   group_display_name        character
                                   game_type_id              character
                                   game_type_description     character
                                   sort_stat_name            character
                                   sort_stat_lookup_param    character
                                   sort_stat_is_counting     logical
                                   sort_stat_label           character
mlb_hit_trajectories                                                                  121
Examples
      try(mlb_high_low_stats(org_type = 'Team', season = 2020, sort_stat = 'atBats'))
  mlb_high_low_types           MLB Stat High/Low Types
Description
    MLB Stat High/Low Types
Usage
    mlb_high_low_types()
Value
    Returns a tibble with the following columns
                                    col_name           types
                                     stat_name         character
                                     stat_lookup_param character
                                     is_counting       logical
                                     stat_label        character
                                     stat_groups       list
                                     org_types         list
                                     high_low_types    list
Examples
      try(mlb_high_low_types())
  mlb_hit_trajectories         MLB Hit Trajectories
Description
    MLB Hit Trajectories
Usage
    mlb_hit_trajectories()
122                                                                            mlb_homerun_derby
Value
    Returns a tibble with the following columns
                                 col_name                    types
                                  hit_trajectory_code        character
                                  hit_trajectory_description character
Examples
      try(mlb_hit_trajectories())
  mlb_homerun_derby            Retrieve Homerun Derby data
Description
    Retrieve Homerun Derby data
Usage
    mlb_homerun_derby(game_pk)
Arguments
    game_pk             The game_pk for which you want to return data
Value
    Returns a tibble with the following columns
                    col_name                                           types
                     game_pk                                           integer
                     event_name                                        character
                     event_date                                        character
                     event_type_code                                   character
                     event_type_name                                   character
                     venue_id                                          integer
                     venue_name                                        character
                     round                                             integer
                     num_batters                                       integer
                     batter                                            character
                     batter_id                                         integer
                     batter_link                                       character
                     top_seed_started                                  logical
mlb_homerun_derby                                                           123
                 top_seed_complete                                logical
                 top_seed_winner                                  logical
                 bonus_time                                       logical
                 home_run                                         logical
                 tie_breaker                                      logical
                 is_home_run                                      logical
                 time_remaining                                   character
                 is_bonus_time                                    logical
                 is_tie_breaker                                   logical
                 hit_data_launch_speed                            integer
                 hit_data_launch_angle                            integer
                 hit_data_total_distance                          integer
                 hit_data_coordinates_coord_x                     numeric
                 hit_data_coordinates_coord_y                     numeric
                 hit_data_coordinates_landing_pos_x               numeric
                 hit_data_coordinates_landing_pos_y               numeric
                 hit_data_trajectory_data_trajectory_polynomial_x list
                 hit_data_trajectory_data_trajectory_polynomial_y list
                 hit_data_trajectory_data_trajectory_polynomial_z list
                 hit_data_trajectory_data_valid_time_interval     list
                 top_seed_seed                                    integer
                 top_seed_is_winner                               logical
                 top_seed_is_complete                             logical
                 top_seed_is_started                              logical
                 top_seed_num_home_runs                           integer
                 top_seed_player_id                               integer
                 top_seed_player_full_name                        character
                 top_seed_player_link                             character
                 top_seed_top_derby_hit_data_launch_speed         integer
                 top_seed_top_derby_hit_data_total_distance       integer
                 bottom_seed_started                              logical
                 bottom_seed_complete                             logical
                 bottom_seed_winner                               logical
                 bottom_seed_seed                                 integer
                 bottom_seed_is_winner                            logical
                 bottom_seed_is_complete                          logical
                 bottom_seed_is_started                           logical
                 bottom_seed_num_home_runs                        integer
                 bottom_seed_player_id                            integer
                 bottom_seed_player_full_name                     character
                 bottom_seed_player_link                          character
                 bottom_seed_top_derby_hit_data_launch_speed      integer
                 bottom_seed_top_derby_hit_data_total_distance    integer
                 venue_link                                       character
                 is_multi_day                                     logical
                 is_primary_calendar                              logical
                 file_code                                        character
                 event_number                                     integer
124                                                                     mlb_homerun_derby_bracket
                     public_facing                                      logical
Examples
      try(mlb_homerun_derby(game_pk = 511101))
  mlb_homerun_derby_bracket
                                Retrieve Homerun Derby Bracket
Description
    Retrieve Homerun Derby Bracket
Usage
    mlb_homerun_derby_bracket(game_pk)
Arguments
    game_pk              The game_pk for which you want to return data
Value
    Returns a tibble with the following columns
                     col_name                                          types
                      game_pk                                          integer
                      event_name                                       character
                      event_type_code                                  character
                      event_type_name                                  character
                      event_date                                       character
                      venue_id                                         integer
                      venue_name                                       character
                      venue_link                                       character
                      is_multi_day                                     logical
                      is_primary_calendar                              logical
                      file_code                                        character
                      event_number                                     integer
                      public_facing                                    logical
                      round                                            integer
                      num_batters                                      integer
                      top_seed_complete                                logical
                      top_seed_started                                 logical
                      top_seed_winner                                  logical
mlb_homerun_derby_players                                                    125
                   top_seed_seed                                   integer
                   top_seed_is_winner                              logical
                   top_seed_is_complete                            logical
                   top_seed_is_started                             logical
                   top_seed_num_home_runs                          integer
                   top_seed_player_id                              integer
                   top_seed_player_full_name                       character
                   top_seed_player_link                            character
                   top_seed_top_derby_hit_data_launch_speed        integer
                   top_seed_top_derby_hit_data_total_distance      integer
                   bottom_seed_complete                            logical
                   bottom_seed_started                             logical
                   bottom_seed_winner                              logical
                   bottom_seed_seed                                integer
                   bottom_seed_is_winner                           logical
                   bottom_seed_is_complete                         logical
                   bottom_seed_is_started                          logical
                   bottom_seed_num_home_runs                       integer
                   bottom_seed_player_id                           integer
                   bottom_seed_player_full_name                    character
                   bottom_seed_player_link                         character
                   bottom_seed_top_derby_hit_data_launch_speed     integer
                   bottom_seed_top_derby_hit_data_total_distance   integer
Examples
      try(mlb_homerun_derby_bracket(game_pk = 511101))
  mlb_homerun_derby_players
                           Retrieve Homerun Derby Players
Description
    Retrieve Homerun Derby Players
Usage
    mlb_homerun_derby_players(game_pk)
Arguments
    game_pk          The game_pk for which you want to return data
126                                              mlb_homerun_derby_players
Value
    Returns a tibble with the following columns
                    col_name                     types
                     game_pk                     integer
                     event_name                  character
                     event_date                  character
                     event_type_code             character
                     event_type_name             character
                     venue_id                    integer
                     venue_name                  character
                     player_id                   integer
                     player_full_name            character
                     player_link                 character
                     player_first_name           character
                     player_last_name            character
                     player_primary_number       character
                     player_birth_date           character
                     player_current_age          integer
                     player_birth_city           character
                     player_birth_state_province character
                     player_birth_country        character
                     player_height               character
                     player_weight               integer
                     player_active               logical
                     player_use_name             character
                     player_middle_name          character
                     player_boxscore_name        character
                     player_nick_name            character
                     player_gender               character
                     player_is_player            logical
                     player_is_verified          logical
                     player_draft_year           integer
                     player_pronunciation        character
                     player_mlb_debut_date       character
                     player_name_first_last      character
                     player_name_slug            character
                     player_first_last_name      character
                     player_last_first_name      character
                     player_last_init_name       character
                     player_init_last_name       character
                     player_full_fml_name        character
                     player_full_lfm_name        character
                     player_strike_zone_top      numeric
                     player_strike_zone_bottom   numeric
                     player_name_matrilineal     character
                     player_current_team_id      integer
                     player_current_team_name    character
mlb_homerun_derby_players                                                 127
                 player_current_team_link                       character
                 player_current_team_season                     integer
                 player_current_team_team_code                  character
                 player_current_team_file_code                  character
                 player_current_team_abbreviation               character
                 player_current_team_team_name                  character
                 player_current_team_location_name              character
                 player_current_team_first_year_of_play         character
                 player_current_team_short_name                 character
                 player_current_team_franchise_name             character
                 player_current_team_club_name                  character
                 player_current_team_all_star_status            character
                 player_current_team_active                     logical
                 player_current_team_parent_org_name            character
                 player_current_team_parent_org_id              integer
                 player_current_team_venue_id                   integer
                 player_current_team_venue_name                 character
                 player_current_team_venue_link                 character
                 player_current_team_spring_venue_id            integer
                 player_current_team_spring_venue_link          character
                 player_current_team_league_id                  integer
                 player_current_team_league_name                character
                 player_current_team_league_link                character
                 player_current_team_division_id                integer
                 player_current_team_division_name              character
                 player_current_team_division_link              character
                 player_current_team_sport_id                   integer
                 player_current_team_sport_link                 character
                 player_current_team_sport_name                 character
                 player_current_team_spring_league_id           integer
                 player_current_team_spring_league_name         character
                 player_current_team_spring_league_link         character
                 player_current_team_spring_league_abbreviation character
                 player_primary_position_code                   character
                 player_primary_position_name                   character
                 player_primary_position_type                   character
                 player_primary_position_abbreviation           character
                 player_bat_side_code                           character
                 player_bat_side_description                    character
                 player_pitch_hand_code                         character
                 player_pitch_hand_description                  character
                 venue_link                                     character
                 is_multi_day                                   logical
                 is_primary_calendar                            logical
                 file_code                                      character
                 event_number                                   integer
                 public_facing                                  logical
128                                                                            mlb_jobs_datacasters
Examples
      try(mlb_homerun_derby_players(game_pk = 511101))
  mlb_jobs                     MLB Jobs
Description
    MLB Jobs
Usage
    mlb_jobs(job_type = "UMPR", sport_id = NULL, date = NULL)
Arguments
    job_type            Return information for a given job_type. See mlb_job_types()
    sport_id            Return information for a given sport_id.
    date                Return information for a given date.
Value
    Returns a tibble with the following columns
                                    col_name              types
                                     jersey_number        character
                                     job                  character
                                     job_code             character
                                     title                character
                                     person_id            integer
                                     person_full_name     character
                                     person_link          character
Examples
      try(mlb_jobs(job_type='UMPR'))
  mlb_jobs_datacasters         MLB Jobs Datacasters
mlb_jobs_official_scorers                                           129
Description
    MLB Jobs Datacasters
Usage
    mlb_jobs_datacasters(sport_id = NULL, date = NULL)
Arguments
    sport_id            Return information for a given sport_id.
    date                Return information for a given date.
Value
    Returns a tibble with the following columns
                                    col_name              types
                                     jersey_number        character
                                     job                  character
                                     job_code             character
                                     title                character
                                     person_id            integer
                                     person_full_name     character
                                     person_link          character
Examples
      try(mlb_jobs_datacasters(sport_id=1))
  mlb_jobs_official_scorers
                               MLB Jobs Official Scorers
Description
    MLB Jobs Official Scorers
Usage
    mlb_jobs_official_scorers(sport_id = NULL, date = NULL)
Arguments
    sport_id            Return information for a given sport_id.
    date                Return information for a given date.
130                                                                 mlb_jobs_umpires
Value
    Returns a tibble with the following columns
                                    col_name              types
                                     jersey_number        character
                                     job                  character
                                     job_code             character
                                     title                character
                                     person_id            integer
                                     person_full_name     character
                                     person_link          character
Examples
      try(mlb_jobs_official_scorers(sport_id=1))
  mlb_jobs_umpires             MLB Jobs Umpires
Description
    MLB Jobs Umpires
Usage
    mlb_jobs_umpires(sport_id = NULL, date = NULL)
Arguments
    sport_id            Return information for a given sport_id.
    date                Return information for a given date.
Value
    Returns a tibble with the following columns
                                    col_name              types
                                     jersey_number        character
                                     job                  character
                                     job_code             character
                                     title                character
                                     person_id            integer
                                     person_full_name     character
                                     person_link          character
mlb_languages                                                 131
Examples
      try(mlb_jobs_umpires(sport_id=1))
  mlb_job_types                MLB Job Types
Description
    MLB Job Types
Usage
    mlb_job_types()
Value
    Returns a tibble with the following columns
                                        col_name    types
                                         job_code   character
                                         job        character
                                         sort_order integer
Examples
      try(mlb_job_types())
  mlb_languages                MLB API Language Options
Description
    MLB API Language Options
Usage
    mlb_languages()
Value
    Returns a tibble with the following columns
132                                                                         mlb_league_leader_types
                                      col_name            types
                                       language_name      character
                                       language_code      character
                                       locale             character
Examples
      try(mlb_languages())
  mlb_league                   MLB Leagues
Description
    MLB Leagues
Usage
    mlb_league(seasons = NULL, sport_id = NULL, league_id = NULL)
Arguments
    seasons             Year(s) to return to return league information for.
    sport_id            The sport_id to return league information for.
    league_id           The league_id(s) to return league information for.
Value
    Returns a tibble with the following columns
                                         col_name       types
                                          leader_type   character
Examples
      try(mlb_league(seasons = 2021, sport_id = 1))
  mlb_league_leader_types
                               MLB League Leader Types
mlb_logical_events                                            133
Description
    MLB League Leader Types
Usage
    mlb_league_leader_types()
Value
    Returns a tibble with the following columns
                                       col_name     types
                                        leader_type character
Examples
      try(mlb_league_leader_types())
  mlb_logical_events           MLB Logical Events
Description
    MLB Logical Events
Usage
    mlb_logical_events()
Value
    Returns a tibble with the following columns
                                       col_name     types
                                        event_code  character
Examples
      try(mlb_logical_events())
134                                                                                      mlb_pbp
  mlb_metrics                  MLB Metrics
Description
    MLB Metrics
Usage
    mlb_metrics()
Value
    Returns a tibble with the following columns
                                      col_name        types
                                       metric_name    character
                                       metric_id      integer
                                       stat_group     character
                                       metric_unit    character
Examples
      try(mlb_metrics())
  mlb_pbp                      Acquire pitch-by-pitch data for Major and Minor League games
Description
    Acquire pitch-by-pitch data for Major and Minor League games
Usage
    mlb_pbp(game_pk)
Arguments
    game_pk             The date for which you want to find game_pk values for MLB games
mlb_pbp                                                                                             135
Value
    Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch
    level.
    Some data will vary depending on the park and the league level, as most sensor data is not available
    in minor league parks via this API. Note that the column names have mostly been left as-is and there
    are likely duplicate columns in terms of the information they provide. I plan to clean the output up
    down the road, but for now I am leaving the majority as-is.
    Both major and minor league pitch-by-pitch data can be pulled with this function.
                             col_name                             types
                              game_pk                             numeric
                              game_date                           character
                              index                               integer
                              startTime                           character
                              endTime                             character
                              isPitch                             logical
                              type                                character
                              playId                              character
                              pitchNumber                         integer
                              details.description                 character
                              details.event                       character
                              details.awayScore                   integer
                              details.homeScore                   integer
                              details.isScoringPlay               logical
                              details.hasReview                   logical
                              details.code                        character
                              details.ballColor                   character
                              details.isInPlay                    logical
                              details.isStrike                    logical
                              details.isBall                      logical
                              details.call.code                   character
                              details.call.description            character
                              count.balls.start                   integer
                              count.strikes.start                 integer
                              count.outs.start                    integer
                              player.id                           integer
                              player.link                         character
                              pitchData.strikeZoneTop             numeric
                              pitchData.strikeZoneBottom          numeric
                              details.fromCatcher                 logical
                              pitchData.coordinates.x             numeric
                              pitchData.coordinates.y             numeric
                              hitData.trajectory                  character
                              hitData.hardness                    character
                              hitData.location                    character
                              hitData.coordinates.coordX          numeric
                              hitData.coordinates.coordY          numeric
                              actionPlayId                        character
136                                         mlb_pbp
    details.eventType             character
    details.runnerGoing           logical
    position.code                 character
    position.name                 character
    position.type                 character
    position.abbreviation         character
    battingOrder                  character
    atBatIndex                    character
    result.type                   character
    result.event                  character
    result.eventType              character
    result.description            character
    result.rbi                    integer
    result.awayScore              integer
    result.homeScore              integer
    about.atBatIndex              integer
    about.halfInning              character
    about.inning                  integer
    about.startTime               character
    about.endTime                 character
    about.isComplete              logical
    about.isScoringPlay           logical
    about.hasReview               logical
    about.hasOut                  logical
    about.captivatingIndex        integer
    count.balls.end               integer
    count.strikes.end             integer
    count.outs.end                integer
    matchup.batter.id             integer
    matchup.batter.fullName       character
    matchup.batter.link           character
    matchup.batSide.code          character
    matchup.batSide.description   character
    matchup.pitcher.id            integer
    matchup.pitcher.fullName      character
    matchup.pitcher.link          character
    matchup.pitchHand.code        character
    matchup.pitchHand.description character
    matchup.splits.batter         character
    matchup.splits.pitcher        character
    matchup.splits.menOnBase      character
    batted.ball.result            factor
    home_team                     character
    home_level_id                 integer
    home_level_name               character
    home_parentOrg_id             integer
    home_parentOrg_name           character
    home_league_id                integer
mlb_pbp                                          137
        home_league_name               character
        away_team                      character
        away_level_id                  integer
        away_level_name                character
        away_parentOrg_id              integer
        away_parentOrg_name            character
        away_league_id                 integer
        away_league_name               character
        batting_team                   character
        fielding_team                  character
        last.pitch.of.ab               character
        pfxId                          character
        details.trailColor             character
        details.type.code              character
        details.type.description       character
        pitchData.startSpeed           numeric
        pitchData.endSpeed             numeric
        pitchData.zone                 integer
        pitchData.typeConfidence       numeric
        pitchData.plateTime            numeric
        pitchData.extension            numeric
        pitchData.coordinates.aY       numeric
        pitchData.coordinates.aZ       numeric
        pitchData.coordinates.pfxX     numeric
        pitchData.coordinates.pfxZ     numeric
        pitchData.coordinates.pX       numeric
        pitchData.coordinates.pZ       numeric
        pitchData.coordinates.vX0      numeric
        pitchData.coordinates.vY0      numeric
        pitchData.coordinates.vZ0      numeric
        pitchData.coordinates.x0       numeric
        pitchData.coordinates.y0       numeric
        pitchData.coordinates.z0       numeric
        pitchData.coordinates.aX       numeric
        pitchData.breaks.breakAngle    numeric
        pitchData.breaks.breakLength   numeric
        pitchData.breaks.breakY        numeric
        pitchData.breaks.spinRate      integer
        pitchData.breaks.spinDirection integer
        hitData.launchSpeed            numeric
        hitData.launchAngle            numeric
        hitData.totalDistance          numeric
        injuryType                     character
        umpire.id                      integer
        umpire.link                    character
        isBaseRunningPlay              logical
        isSubstitution                 logical
        about.isTopInning              logical
138                                                                                   mlb_pbp_diff
                             matchup.postOnFirst.id             integer
                             matchup.postOnFirst.fullName       character
                             matchup.postOnFirst.link           character
                             matchup.postOnSecond.id            integer
                             matchup.postOnSecond.fullName      character
                             matchup.postOnSecond.link          character
                             matchup.postOnThird.id             integer
                             matchup.postOnThird.fullName       character
                             matchup.postOnThird.link           character
Examples
      try(mlb_pbp(game_pk = 632970))
  mlb_pbp_diff                  Acquire pitch-by-pitch data between two timecodes for Major and
                                Minor League games
Description
    Acquire pitch-by-pitch data between two timecodes for Major and Minor League games
Usage
    mlb_pbp_diff(game_pk, start_timecode, end_timecode)
Arguments
    game_pk             The date for which you want to find game_pk values for MLB games
    start_timecode The start time code for the MLB game (format: MMDDYYYY_HHMMSS)
    end_timecode        The end time code for the MLB game (format: MMDDYYYY_HHMMSS)
Value
    Returns a tibble that includes over 100 columns of data provided by the MLB Stats API at a pitch
    level between the start_timecode and end_timecode
                              col_name                         types
                               game_pk                         numeric
                               game_date                       character
                               index                           integer
                               startTime                       character
                               endTime                         character
                               isPitch                         logical
mlb_pbp_diff                                      139
             type                       character
             playId                     character
             pitchNumber                integer
             details.description        character
             details.event              character
             details.awayScore          integer
             details.homeScore          integer
             details.isScoringPlay      logical
             details.hasReview          logical
             details.code               character
             details.ballColor          character
             details.isInPlay           logical
             details.isStrike           logical
             details.isBall             logical
             details.call.code          character
             details.call.description   character
             count.balls.start          integer
             count.strikes.start        integer
             count.outs.start           integer
             player.id                  integer
             player.link                character
             pitchData.strikeZoneTop    numeric
             pitchData.strikeZoneBottom numeric
             details.fromCatcher        logical
             pitchData.coordinates.x    numeric
             pitchData.coordinates.y    numeric
             hitData.trajectory         character
             hitData.hardness           character
             hitData.location           character
             hitData.coordinates.coordX numeric
             hitData.coordinates.coordY numeric
             actionPlayId               character
             details.eventType          character
             details.runnerGoing        logical
             position.code              character
             position.name              character
             position.type              character
             position.abbreviation      character
             battingOrder               character
             atBatIndex                 character
             result.type                character
             result.event               character
             result.eventType           character
             result.description         character
             result.rbi                 integer
             result.awayScore           integer
             result.homeScore           integer
             about.atBatIndex           integer
140                                         mlb_pbp_diff
    about.halfInning              character
    about.inning                  integer
    about.startTime               character
    about.endTime                 character
    about.isComplete              logical
    about.isScoringPlay           logical
    about.hasReview               logical
    about.hasOut                  logical
    about.captivatingIndex        integer
    count.balls.end               integer
    count.strikes.end             integer
    count.outs.end                integer
    matchup.batter.id             integer
    matchup.batter.fullName       character
    matchup.batter.link           character
    matchup.batSide.code          character
    matchup.batSide.description   character
    matchup.pitcher.id            integer
    matchup.pitcher.fullName      character
    matchup.pitcher.link          character
    matchup.pitchHand.code        character
    matchup.pitchHand.description character
    matchup.splits.batter         character
    matchup.splits.pitcher        character
    matchup.splits.menOnBase      character
    batted.ball.result            factor
    home_team                     character
    home_level_id                 integer
    home_level_name               character
    home_parentOrg_id             integer
    home_parentOrg_name           character
    home_league_id                integer
    home_league_name              character
    away_team                     character
    away_level_id                 integer
    away_level_name               character
    away_parentOrg_id             integer
    away_parentOrg_name           character
    away_league_id                integer
    away_league_name              character
    batting_team                  character
    fielding_team                 character
    last.pitch.of.ab              character
    pfxId                         character
    details.trailColor            character
    details.type.code             character
    details.type.description      character
    pitchData.startSpeed          numeric
mlb_people                                                               141
                          pitchData.endSpeed             numeric
                          pitchData.zone                 integer
                          pitchData.typeConfidence       numeric
                          pitchData.plateTime            numeric
                          pitchData.extension            numeric
                          pitchData.coordinates.aY       numeric
                          pitchData.coordinates.aZ       numeric
                          pitchData.coordinates.pfxX     numeric
                          pitchData.coordinates.pfxZ     numeric
                          pitchData.coordinates.pX       numeric
                          pitchData.coordinates.pZ       numeric
                          pitchData.coordinates.vX0      numeric
                          pitchData.coordinates.vY0      numeric
                          pitchData.coordinates.vZ0      numeric
                          pitchData.coordinates.x0       numeric
                          pitchData.coordinates.y0       numeric
                          pitchData.coordinates.z0       numeric
                          pitchData.coordinates.aX       numeric
                          pitchData.breaks.breakAngle    numeric
                          pitchData.breaks.breakLength   numeric
                          pitchData.breaks.breakY        numeric
                          pitchData.breaks.spinRate      integer
                          pitchData.breaks.spinDirection integer
                          hitData.launchSpeed            numeric
                          hitData.launchAngle            numeric
                          hitData.totalDistance          numeric
                          injuryType                     character
                          umpire.id                      integer
                          umpire.link                    character
                          about.isTopInning              logical
                          matchup.postOnFirst.id         integer
                          matchup.postOnFirst.fullName   character
                          matchup.postOnFirst.link       character
Examples
     try(mlb_pbp_diff(game_pk = 632970,
                      start_timecode = "20210808_231704",
                      end_timecode = "20210808_233711"))
  mlb_people               Find Biographical Information for MLB Players
142                                                                                     mlb_people
Description
    Find Biographical Information for MLB Players
Usage
    mlb_people(person_ids = NULL)
Arguments
    person_ids          MLBAMIDs for players of interest. Multiple IDs should be provided in a vector
                        separated by a comma.
Value
    Returns a tibble with the following columns:
                              col_name                       types
                               id                            integer
                               full_name                     character
                               link                          character
                               first_name                    character
                               last_name                     character
                               primary_number                character
                               birth_date                    character
                               current_age                   integer
                               birth_city                    character
                               birth_state_province          character
                               birth_country                 character
                               height                        character
                               weight                        integer
                               active                        logical
                               use_name                      character
                               middle_name                   character
                               boxscore_name                 character
                               nick_name                     character
                               gender                        character
                               is_player                     logical
                               is_verified                   logical
                               draft_year                    integer
                               mlb_debut_date                character
                               name_first_last               character
                               name_slug                     character
                               first_last_name               character
                               last_first_name               character
                               last_init_name                character
                               init_last_name                character
                               full_fml_name                 character
                               full_lfm_name                 character
                               strike_zone_top               numeric
mlb_people_free_agents                                                    143
                               strike_zone_bottom               numeric
                               pronunciation                    character
                               primary_position_code            character
                               primary_position_name            character
                               primary_position_type            character
                               primary_position_abbreviation    character
                               bat_side_code                    character
                               bat_side_description             character
                               pitch_hand_code                  character
                               pitch_hand_description           character
Examples
      try(mlb_people(person_ids = 502671))
      try(mlb_people(person_ids = c(502671,605151)))
  mlb_people_free_agents
                                Find Information About MLB Free Agents
Description
    Find Information About MLB Free Agents
Usage
    mlb_people_free_agents(season = NULL)
Arguments
    season              Season preceding free agency
Value
    Returns a tibble with the following columns:
                                    col_name               types
                                     date_declared         character
                                     notes                 character
                                     date_signed           character
                                     sort_order            integer
                                     player_id             integer
                                     player_full_name      character
                                     player_link           character
                                     original_team_id      integer
144                                                                  mlb_pitch_types
                                   original_team_name      character
                                   original_team_link      character
                                   position_code           character
                                   position_name           character
                                   position_type           character
                                   position_abbreviation   character
                                   new_team_id             integer
                                   new_team_name           character
                                   new_team_link           character
Examples
      try(mlb_people_free_agents(season = 2018))
  mlb_pitch_codes              MLB Pitch Codes
Description
    MLB Pitch Codes
Usage
    mlb_pitch_codes()
Value
    Returns a tibble with the following columns
                                     col_name            types
                                      pitch_code         character
                                      pitch_description  character
Examples
      try(mlb_pitch_codes())
  mlb_pitch_types              MLB Pitch Types
mlb_player_game_stats                                                                            145
Description
    MLB Pitch Types
Usage
    mlb_pitch_types()
Value
    Returns a tibble with the following columns
                                   col_name                types
                                    pitch_type_code        character
                                    pitch_type_description character
Examples
      try(mlb_pitch_types())
  mlb_player_game_stats Find MLB Player Game Stats
Description
    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_name                    types
                                  type                       character
                                  group                      character
                                  assists                    integer
146                                  mlb_player_game_stats
    put_outs               integer
    errors                 integer
    chances                integer
    fielding               character
    caught_stealing        integer
    passed_ball            integer
    stolen_bases           integer
    stolen_base_percentage character
    pickoffs               integer
    games_played           integer
    games_started          integer
    fly_outs               integer
    ground_outs            integer
    air_outs               integer
    runs                   integer
    doubles                integer
    triples                integer
    home_runs              integer
    strike_outs            integer
    base_on_balls          integer
    intentional_walks      integer
    hits                   integer
    hit_by_pitch           integer
    at_bats                integer
    number_of_pitches      integer
    innings_pitched        character
    wins                   integer
    losses                 integer
    saves                  integer
    save_opportunities     integer
    holds                  integer
    blown_saves            integer
    earned_runs            integer
    batters_faced          integer
    outs                   integer
    games_pitched          integer
    complete_games         integer
    shutouts               integer
    pitches_thrown         integer
    balls                  integer
    strikes                integer
    strike_percentage      character
    hit_batsmen            integer
    balks                  integer
    wild_pitches           integer
    rbi                    integer
    games_finished         integer
    runs_scored_per9       character
mlb_player_game_stats                                    147
                      home_runs_per9           character
                      inherited_runners        integer
                      inherited_runners_scored integer
                      catchers_interference    integer
                      sac_bunts                integer
                      sac_flies                integer
                      ground_into_double_play  integer
                      ground_into_triple_play  integer
                      plate_appearances        integer
                      total_bases              integer
                      left_on_base             integer
                      at_bats_per_home_run     character
                      game_type                character
                      num_teams                integer
                      avg                      character
                      obp                      character
                      slg                      character
                      ops                      character
                      outs_pitched             integer
                      whip                     character
                      ground_outs_to_airouts   character
                      pitches_per_inning       character
                      strikeout_walk_ratio     character
                      strikeouts_per9inn       character
                      walks_per9inn            character
                      hits_per9inn             character
                      team_id                  integer
                      team_name                character
                      team_link                character
                      opponent_id              integer
                      opponent_name            character
                      opponent_link            character
                      pitcher_id               integer
                      pitcher_full_name        character
                      pitcher_link             character
                      pitcher_first_name       character
                      pitcher_last_name        character
                      batter_id                integer
                      batter_full_name         character
                      batter_link              character
                      batter_first_name        character
                      batter_last_name         character
                      total_splits             integer
                      type_display_name        character
                      group_display_name       character
                      player_id                numeric
                      game_pk                  numeric
148                                                                mlb_player_game_stats_current
Examples
     try(mlb_player_game_stats(person_id = 605151, game_pk = 531368))
  mlb_player_game_stats_current
                               Find MLB Player Game Stats - Current Game
Description
    Find MLB Player Game Stats - Current Game
Usage
    mlb_player_game_stats_current(person_id = NULL)
Arguments
    person_id           MLBAMIDs for player of interest.
Value
    Returns a tibble with the following columns:
                              col_name                     types
                               type                        character
                               group                       character
                               stat_assists                integer
                               stat_put_outs               integer
                               stat_errors                 integer
                               stat_chances                integer
                               stat_fielding               character
                               stat_caught_stealing        integer
                               stat_passed_ball            integer
                               stat_stolen_bases           integer
                               stat_stolen_base_percentage character
                               stat_pickoffs               integer
                               stat_games_played           integer
                               stat_games_started          integer
                               stat_fly_outs               integer
                               stat_ground_outs            integer
                               stat_air_outs               integer
                               stat_runs                   integer
                               stat_doubles                integer
                               stat_triples                integer
                               stat_home_runs              integer
mlb_player_game_stats_current                                      149
                           stat_strike_outs              integer
                           stat_base_on_balls            integer
                           stat_intentional_walks        integer
                           stat_hits                     integer
                           stat_hit_by_pitch             integer
                           stat_at_bats                  integer
                           stat_number_of_pitches        integer
                           stat_innings_pitched          character
                           stat_wins                     integer
                           stat_losses                   integer
                           stat_saves                    integer
                           stat_save_opportunities       integer
                           stat_holds                    integer
                           stat_blown_saves              integer
                           stat_earned_runs              integer
                           stat_batters_faced            integer
                           stat_outs                     integer
                           stat_games_pitched            integer
                           stat_complete_games           integer
                           stat_shutouts                 integer
                           stat_pitches_thrown           integer
                           stat_balls                    integer
                           stat_strikes                  integer
                           stat_strike_percentage        character
                           stat_hit_batsmen              integer
                           stat_balks                    integer
                           stat_wild_pitches             integer
                           stat_rbi                      integer
                           stat_games_finished           integer
                           stat_runs_scored_per9         character
                           stat_home_runs_per9           character
                           stat_inherited_runners        integer
                           stat_inherited_runners_scored integer
                           stat_catchers_interference    integer
                           stat_sac_bunts                integer
                           stat_sac_flies                integer
                           stat_ground_into_double_play  integer
                           stat_ground_into_triple_play  integer
                           stat_plate_appearances        integer
                           stat_total_bases              integer
                           stat_left_on_base             integer
                           stat_at_bats_per_home_run     character
                           game_type                     character
                           num_teams                     integer
                           stat_avg                      character
                           stat_obp                      character
                           stat_slg                      character
                           stat_ops                      character
150                                                                mlb_player_status_codes
                           stat_outs_pitched             integer
                           stat_whip                     character
                           stat_ground_outs_to_airouts   character
                           stat_pitches_per_inning       character
                           stat_strikeout_walk_ratio     character
                           stat_strikeouts_per9inn       character
                           stat_walks_per9inn            character
                           stat_hits_per9inn             character
                           team_id                       integer
                           team_name                     character
                           team_link                     character
                           opponent_id                   integer
                           opponent_name                 character
                           opponent_link                 character
                           pitcher_id                    integer
                           pitcher_full_name             character
                           pitcher_link                  character
                           pitcher_first_name            character
                           pitcher_last_name             character
                           batter_id                     integer
                           batter_full_name              character
                           batter_link                   character
                           batter_first_name             character
                           batter_last_name              character
                           total_splits                  integer
                           type_display_name             character
                           group_display_name            character
                           player_id                     numeric
                           game_pk                       numeric
Examples
      try(mlb_player_game_stats_current(person_id = 660271))
  mlb_player_status_codes
                           MLB Player Status Codes
Description
    MLB Player Status Codes
Usage
    mlb_player_status_codes()
mlb_positions                                                          151
Value
    Returns a tibble with the following columns
                                 col_name                    types
                                  player_status_code         character
                                  player_status_description  character
Examples
      mlb_player_status_codes()
  mlb_positions                MLB Positions
Description
    MLB Positions
Usage
    mlb_positions()
Value
    Returns a tibble with the following columns
                                  col_name                  types
                                   position_short_name      character
                                   position_full_name       character
                                   position_abbreviation    character
                                   position_code            character
                                   position_type            character
                                   position_formal_name     character
                                   game_position            logical
                                   pitcher                  logical
                                   fielder                  logical
                                   outfield                 logical
                                   position_display_name    character
Examples
      try(mlb_positions())
152                                                                                mlb_review_reasons
  mlb_probables                 Retrieve probable starters for a given MLB game
Description
    Retrieve probable starters for a given MLB game
Usage
    mlb_probables(game_pk)
Arguments
    game_pk             The unique game_pk identifier for the game
Value
    Returns a tiible that includes probable starting pitchers and the home plate umpire for the game_pk
    requested including the following columns:
                                   col_name                   types
                                    game_pk                   integer
                                    game_date                 character
                                    fullName                  character
                                    id                        integer
                                    team                      character
                                    team_id                   integer
                                    home_plate_full_name      character
                                    home_plate_id             integer
Examples
      try(mlb_probables(566001))
  mlb_review_reasons            MLB Review Reasons
Description
    MLB Review Reasons
mlb_rosters                                                                                            153
Usage
    mlb_review_reasons()
Value
    Returns a tibble with the following columns
                                col_name                         types
                                 review_reason_code              character
                                 review_reason_description       character
Examples
      try(mlb_review_reasons())
  mlb_rosters                  Find MLB Rosters by Roster Type
Description
    Find MLB Rosters by Roster Type
Usage
    mlb_rosters(team_id = NULL, season = NULL, date = NULL, roster_type = NULL)
Arguments
    team_id             team_id to return team roster information for a particular club.
    season              Year to return team roster information for a particular club in a specific season.
    date                Date to return team roster and their coaching staff directorial information for a
                        particular team.
    roster_type         roster_type to return team directorial information for. See mlb_roster_types()
                        for more options. Valid options include: ’40Man’, ’fullSeason’, ’fullRoster’,
                        ’nonRosterInvitees’, ’active’, ’allTime’, ’depthChart’, ’gameday’, ’coach’
Value
    Returns a tibble with the following columns:
                                    col_name                  types
                                     jersey_number            character
                                     person_id                integer
                                     person_full_name         character
154                                                                          mlb_roster_types
                                    person_link           character
                                    position_code         character
                                    position_name         character
                                    position_type         character
                                    position_abbreviation character
                                    status_code           character
                                    status_description    character
                                    link                  character
                                    team_id               integer
                                    roster_type           character
                                    season                numeric
                                    date                  character
Examples
      try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'active'))
      try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'coach'))
  mlb_roster_types             MLB Roster Types
Description
    MLB Roster Types
Usage
    mlb_roster_types()
Value
    Returns a tibble with the following columns
                                 col_name                   types
                                  roster_type_description   character
                                  roster_type_lookup_name   character
                                  roster_type_parameter     character
Examples
      try(mlb_roster_types())
mlb_schedule                                                                                       155
  mlb_runner_detail_types
                                MLB Runner Detail Types
Description
    MLB Runner Detail Types
Usage
    mlb_runner_detail_types()
Value
    Returns a tibble with the following columns
                                         col_name       types
                                          stat_name     character
Examples
      try(mlb_runner_detail_types())
  mlb_schedule                  Find game_pk values for professional baseball games (major and
                                minor leagues)
Description
    Find game_pk values for professional baseball games (major and minor leagues)
Usage
    mlb_schedule(season = 2019, level_ids = "1")
Arguments
    season              The season for which you want to find game_pk values for MLB games
    level_ids           A numeric vector with ids for each level where game_pks are desired. See below
                        for a reference of level ids.
 sport_id   sport_code     sport_link             sport_name                           sport_abbreviation sort_order active
        1   mlb            /api/v1/sports/1       Major League Baseball                MLB                        11 TRU
156                                                                                   mlb_schedule
       11   aaa           /api/v1/sports/11    Triple-A                              AAA              101 TRU
       12   aax           /api/v1/sports/12    Double-A                              AA               201 TRU
       13   afa           /api/v1/sports/13    High-A                                A+               301 TRU
       14   afx           /api/v1/sports/14    Low-A                                 A                401 TRU
       16   rok           /api/v1/sports/16    Rookie                                ROK              701 TRU
       17   win           /api/v1/sports/17    Winter Leagues                        WIN             1301 TRU
        8   bbl           /api/v1/sports/8     Organized Baseball                    Pros            1401 TRU
       21   min           /api/v1/sports/21    Minor League Baseball                 Minors          1402 TRU
       23   ind           /api/v1/sports/23    Independent Leagues                   IND             2101 TRU
       51   int           /api/v1/sports/51    International Baseball                INT             3501 TRU
     508    nat           /api/v1/sports/508   International Baseball (Collegiate)   INTC            3502 TRU
     509    nae           /api/v1/sports/509   International Baseball (18 and under) 18U             3503 TRU
     510    nas           /api/v1/sports/510   International Baseball (16 and under) 16U             3505 TRU
       22   bbc           /api/v1/sports/22    College Baseball                      College         5101 TRU
     586    hsb           /api/v1/sports/586   High School Baseball                  H.S.            6201 TRU
Value
    Returns a tibble which includes game_pk values and additional information for games scheduled or
    played with the following columns:
                           col_name                              types
                            date                                 character
                            total_items                          integer
                            total_events                         integer
                            total_games                          integer
                            total_games_in_progress              integer
                            game_pk                              integer
                            link                                 character
                            game_type                            character
                            season                               character
                            game_date                            character
                            official_date                        character
                            game_number                          integer
                            public_facing                        logical
                            double_header                        character
                            gameday_type                         character
                            tiebreaker                           character
                            calendar_event_id                    character
                            season_display                       character
                            day_night                            character
                            scheduled_innings                    integer
                            reverse_home_away_status             logical
                            inning_break_length                  integer
                            games_in_series                      integer
                            series_game_number                   integer
                            series_description                   character
                            record_source                        character
mlb_schedule                                                             157
                          if_necessary                         character
                          if_necessary_description             character
                          status_abstract_game_state           character
                          status_coded_game_state              character
                          status_detailed_state                character
                          status_status_code                   character
                          status_start_time_tbd                logical
                          status_reason                        character
                          status_abstract_game_code            character
                          teams_away_split_squad               logical
                          teams_away_series_number             integer
                          teams_away_league_record_wins        integer
                          teams_away_league_record_losses      integer
                          teams_away_league_record_pct         character
                          teams_away_team_id                   integer
                          teams_away_team_name                 character
                          teams_away_team_link                 character
                          teams_home_split_squad               logical
                          teams_home_series_number             integer
                          teams_home_league_record_wins        integer
                          teams_home_league_record_losses      integer
                          teams_home_league_record_pct         character
                          teams_home_team_id                   integer
                          teams_home_team_name                 character
                          teams_home_team_link                 character
                          venue_id                             integer
                          venue_name                           character
                          venue_link                           character
                          content_link                         character
                          is_tie                               logical
                          description                          character
                          teams_away_score                     integer
                          teams_away_is_winner                 logical
                          teams_home_score                     integer
                          teams_home_is_winner                 logical
                          reschedule_date                      character
                          reschedule_game_date                 character
                          rescheduled_from                     character
                          rescheduled_from_date                character
                          resume_date                          character
                          resume_game_date                     character
                          resumed_from                         character
                          resumed_from_date                    character
                          events                               list
Level IDs
    The following IDs can be passed to the level_ids argument:
158                                                                 mlb_schedule_event_types
    1 = MLB
    11 = Triple-A
    12 = Doubl-A
    13 = Class A Advanced
    14 = Class A
    15 = Class A Short Season
    5442 = Rookie Advanced
    16 = Rookie
    17 = Winter League
Examples
      try(mlb_schedule(season = "2019"))
  mlb_schedule_event_types
                               MLB Schedule Event Types
Description
    MLB Schedule Event Types
Usage
    mlb_schedule_event_types()
Value
    Returns a tibble with the following columns
                                col_name                  types
                                 schedule_event_type_code character
                                 schedule_event_type_name character
Examples
      try(mlb_schedule_event_types())
mlb_schedule_games_tied                                                                        159
  mlb_schedule_games_tied
                                Find game_pk values for professional baseball games (major and
                                minor leagues) that are tied
Description
    Find game_pk values for professional baseball games (major and minor leagues) that are tied
Usage
    mlb_schedule_games_tied(season = 2021, game_type = "S")
Arguments
    season             The season for which you want to find game_pk values for MLB games
    game_type          game_type to return schedule information for all tied games in a particular
                       game_type
                             game_type_id    game_type_description
                              S              Spring Training
                              R              Regular Season
                              F              Wild Card Game
                              D              Division Series
                              L              League Championship Series
                              W              World Series
                              C              Championship
                              N              Nineteenth Century Series
                              P              Playoffs
                              A              All-Star Game
                              I              Intrasquad
                              E              Exhibition
Value
    Returns a tibble that includes game_pk values and additional information for games scheduled or
    played
                            col_name                            types
                             date                               character
                             total_items                        integer
                             total_events                       integer
                             total_games                        integer
                             total_games_in_progress            integer
                             game_pk                            integer
                             link                               character
160                                           mlb_schedule_games_tied
    game_type                       character
    season                          character
    game_date                       character
    official_date                   character
    game_number                     integer
    public_facing                   logical
    double_header                   character
    gameday_type                    character
    tiebreaker                      character
    calendar_event_id               character
    season_display                  character
    day_night                       character
    scheduled_innings               integer
    reverse_home_away_status        logical
    inning_break_length             integer
    games_in_series                 integer
    series_game_number              integer
    series_description              character
    record_source                   character
    if_necessary                    character
    if_necessary_description        character
    status_abstract_game_state      character
    status_coded_game_state         character
    status_detailed_state           character
    status_status_code              character
    status_start_time_tbd           logical
    status_reason                   character
    status_abstract_game_code       character
    teams_away_split_squad          logical
    teams_away_series_number        integer
    teams_away_league_record_wins   integer
    teams_away_league_record_losses integer
    teams_away_league_record_pct    character
    teams_away_team_id              integer
    teams_away_team_name            character
    teams_away_team_link            character
    teams_home_split_squad          logical
    teams_home_series_number        integer
    teams_home_league_record_wins   integer
    teams_home_league_record_losses integer
    teams_home_league_record_pct    character
    teams_home_team_id              integer
    teams_home_team_name            character
    teams_home_team_link            character
    venue_id                        integer
    venue_name                      character
    venue_link                      character
    content_link                    character
mlb_schedule_postseason                                                                     161
                         is_tie                               logical
                         description                          character
                         teams_away_score                     integer
                         teams_away_is_winner                 logical
                         teams_home_score                     integer
                         teams_home_is_winner                 logical
                         reschedule_date                      character
                         reschedule_game_date                 character
                         rescheduled_from                     character
                         rescheduled_from_date                character
                         resume_date                          character
                         resume_game_date                     character
                         resumed_from                         character
                         resumed_from_date                    character
                         events                               list
Examples
      try(mlb_schedule_games_tied(season = 2021))
  mlb_schedule_postseason
                            Find game_pk values for professional baseball postseason games
                            (major and minor leagues)
Description
    Find game_pk values for professional baseball postseason games (major and minor leagues)
Usage
    mlb_schedule_postseason(
      season = 2021,
      game_type = NULL,
      series_number = NULL,
      sport_id = 1,
      team_id = NULL
    )
Arguments
    season           The season for which you want to find game_pk values for MLB games
    game_type        game_type to return schedule information for all tied games in a particular
                     game_type
162                                                                        mlb_schedule_postseason
    series_number      The Series number to return schedule information for all tied games in a partic-
                       ular series number
    sport_id           The sport_id to return schedule information for.
    team_id            The team_id to return schedule information for.
                             game_type_id    game_type_description
                              S              Spring Training
                              R              Regular Season
                              F              Wild Card Game
                              D              Division Series
                              L              League Championship Series
                              W              World Series
                              C              Championship
                              N              Nineteenth Century Series
                              P              Playoffs
                              A              All-Star Game
                              I              Intrasquad
                              E              Exhibition
Value
    Returns a tibble that includes game_pk values and additional information for games scheduled or
    played
                            col_name                             types
                             date                                character
                             total_items                         integer
                             total_events                        integer
                             total_games                         integer
                             total_games_in_progress             integer
                             game_pk                             integer
                             link                                character
                             game_type                           character
                             season                              character
                             game_date                           character
                             official_date                       character
                             is_tie                              logical
                             is_featured_game                    logical
                             game_number                         integer
                             public_facing                       logical
                             double_header                       character
                             gameday_type                        character
                             tiebreaker                          character
                             calendar_event_id                   character
                             season_display                      character
                             day_night                           character
                             description                         character
mlb_schedule_postseason                                           163
                        scheduled_innings               integer
                        reverse_home_away_status        logical
                        games_in_series                 integer
                        series_game_number              integer
                        series_description              character
                        record_source                   character
                        if_necessary                    character
                        if_necessary_description        character
                        status_abstract_game_state      character
                        status_coded_game_state         character
                        status_detailed_state           character
                        status_status_code              character
                        status_start_time_tbd           logical
                        status_abstract_game_code       character
                        teams_away_score                integer
                        teams_away_is_winner            logical
                        teams_away_split_squad          logical
                        teams_away_series_number        integer
                        teams_away_league_record_wins   integer
                        teams_away_league_record_losses integer
                        teams_away_league_record_pct    character
                        teams_away_team_id              integer
                        teams_away_team_name            character
                        teams_away_team_link            character
                        teams_home_score                integer
                        teams_home_is_winner            logical
                        teams_home_split_squad          logical
                        teams_home_series_number        integer
                        teams_home_league_record_wins   integer
                        teams_home_league_record_losses integer
                        teams_home_league_record_pct    character
                        teams_home_team_id              integer
                        teams_home_team_name            character
                        teams_home_team_link            character
                        venue_id                        integer
                        venue_name                      character
                        venue_link                      character
                        content_link                    character
                        inning_break_length             integer
                        reschedule_date                 character
                        reschedule_game_date            character
                        status_reason                   character
                        rescheduled_from                character
                        rescheduled_from_date           character
                        is_default_game                 logical
                        events                          list
164                                                                mlb_schedule_postseason_series
Examples
      try(mlb_schedule_postseason(season = 2021))
  mlb_schedule_postseason_series
                             Find game_pk values for professional baseball postseason series
                             games (major and minor leagues)
Description
    Find game_pk values for professional baseball postseason series games (major and minor
    leagues)
Usage
    mlb_schedule_postseason_series(
       season = 2021,
       game_type = NULL,
       series_number = NULL,
       sport_id = 1,
       team_id = NULL
    )
Arguments
    season           The season for which you want to find game_pk values for MLB games
    game_type        game_type to return schedule information for all tied games in a particular
                     game_type
    series_number    The Series number to return schedule information for all tied games in a partic-
                     ular series number
    sport_id         The sport_id to return schedule information for.
    team_id          The team_id to return schedule information for.
                          game_type_id     game_type_description
                           S               Spring Training
                           R               Regular Season
                           F               Wild Card Game
                           D               Division Series
                           L               League Championship Series
                           W               World Series
                           C               Championship
                           N               Nineteenth Century Series
                           P               Playoffs
                           A               All-Star Game
mlb_schedule_postseason_series                                                                 165
                              I               Intrasquad
                              E               Exhibition
Value
    Returns a tibble that includes game_pk values and additional information for games scheduled or
    played
                            col_name                            types
                             total_items                        integer
                             total_games                        integer
                             total_games_in_progress            integer
                             game_pk                            integer
                             link                               character
                             game_type                          character
                             season                             character
                             game_date                          character
                             official_date                      character
                             is_tie                             logical
                             is_featured_game                   logical
                             game_number                        integer
                             public_facing                      logical
                             double_header                      character
                             gameday_type                       character
                             tiebreaker                         character
                             calendar_event_id                  character
                             season_display                     character
                             day_night                          character
                             description                        character
                             scheduled_innings                  integer
                             reverse_home_away_status           logical
                             inning_break_length                integer
                             games_in_series                    integer
                             series_game_number                 integer
                             series_description                 character
                             record_source                      character
                             if_necessary                       character
                             if_necessary_description           character
                             is_default_game                    logical
                             status_abstract_game_state         character
                             status_coded_game_state            character
                             status_detailed_state              character
                             status_status_code                 character
                             status_start_time_tbd              logical
                             status_abstract_game_code          character
                             teams_away_score                   integer
                             teams_away_is_winner               logical
                             teams_away_split_squad             logical
166                                                                    mlb_seasons
                         teams_away_series_number          integer
                         teams_away_league_record_wins     integer
                         teams_away_league_record_losses   integer
                         teams_away_league_record_pct      character
                         teams_away_team_id                integer
                         teams_away_team_name              character
                         teams_away_team_link              character
                         teams_home_score                  integer
                         teams_home_is_winner              logical
                         teams_home_split_squad            logical
                         teams_home_series_number          integer
                         teams_home_league_record_wins     integer
                         teams_home_league_record_losses   integer
                         teams_home_league_record_pct      character
                         teams_home_team_id                integer
                         teams_home_team_name              character
                         teams_home_team_link              character
                         venue_id                          integer
                         venue_name                        character
                         venue_link                        character
                         content_link                      character
                         reschedule_date                   character
                         reschedule_game_date              character
                         rescheduled_from                  character
                         rescheduled_from_date             character
                         status_reason                     character
                         sort_order                        integer
                         series_id                         character
                         series_sort_number                integer
                         series_is_default                 logical
                         series_game_type                  character
Examples
      try(mlb_schedule_postseason_series(season = 2021, sport_id = 1))
  mlb_seasons               Find MLB Seasons
Description
    Find MLB Seasons
mlb_seasons_all                                                           167
Usage
    mlb_seasons(sport_id = 1, with_game_type_dates = TRUE)
Arguments
    sport_id            The sport_id to return season information for.
    with_game_type_dates
                        with_game_type_dates to return season information
Value
    Returns a tibble with the following columns:
                               col_name                        types
                                season_id                      character
                                has_wildcard                   logical
                                pre_season_start_date          character
                                pre_season_end_date            character
                                season_start_date              character
                                spring_start_date              character
                                spring_end_date                character
                                regular_season_start_date      character
                                last_date1st_half              character
                                all_star_date                  character
                                first_date2nd_half             character
                                regular_season_end_date        character
                                post_season_start_date         character
                                post_season_end_date           character
                                season_end_date                character
                                offseason_start_date           character
                                off_season_end_date            character
                                season_level_gameday_type      character
                                game_level_gameday_type        character
                                qualifier_plate_appearances    numeric
                                qualifier_outs_pitched         integer
Examples
     mlb_seasons(sport_id = 1)
  mlb_seasons_all              Find MLB Seasons all
168                                                                            mlb_seasons_all
Description
    Find MLB Seasons all
Usage
    mlb_seasons_all(
      sport_id = 1,
      division_id = NULL,
      league_id = NULL,
      with_game_type_dates = TRUE
    )
Arguments
    sport_id            The sport_id to return season information for.
    division_id         The division_id to return season information for.
    league_id           The league_id to return season information for.
    with_game_type_dates
                        with_game_type_dates to return season information for.
Value
    Returns a tibble with the following columns:
                               col_name                        types
                                season_id                      character
                                has_wildcard                   logical
                                pre_season_start_date          character
                                season_start_date              character
                                regular_season_start_date      character
                                regular_season_end_date        character
                                season_end_date                character
                                offseason_start_date           character
                                off_season_end_date            character
                                season_level_gameday_type      character
                                game_level_gameday_type        character
                                qualifier_plate_appearances    numeric
                                qualifier_outs_pitched         integer
                                post_season_start_date         character
                                post_season_end_date           character
                                last_date1st_half              character
                                all_star_date                  character
                                first_date2nd_half             character
                                pre_season_end_date            character
                                spring_start_date              character
                                spring_end_date                character
mlb_sky                                                               169
Examples
     mlb_seasons_all(sport_id = 1)
  mlb_situation_codes          MLB Situation Codes
Description
    MLB Situation Codes
Usage
    mlb_situation_codes()
Value
    Returns a tibble with the following columns
                                col_name                    types
                                 situation_code             character
                                 sort_order                 integer
                                 navigation_menu            character
                                 situation_code_description character
                                 team                       logical
                                 batting                    logical
                                 fielding                   logical
                                 pitching                   logical
Examples
      try(mlb_situation_codes())
  mlb_sky                      MLB Sky (Weather) Codes
Description
    MLB Sky (Weather) Codes
Usage
    mlb_sky()
170                                                                        mlb_sports
Value
    Returns a tibble with the following columns
                                       col_name          types
                                        sky_code         character
                                        sky_description  character
Examples
      try(mlb_sky())
  mlb_sports                    MLB Sport IDs
Description
    MLB Sport IDs
Usage
    mlb_sports(sport_id = NULL)
Arguments
    sport_id            The sport_id to return information for.
Value
    Returns a tibble with the following columns
                                     col_name              types
                                      sport_id             integer
                                      sport_code           character
                                      sport_link           character
                                      sport_name           character
                                      sport_abbreviation   character
                                      sort_order           integer
                                      active_status        logical
    and the following values:
 sport_id   sport_code     sport_link            sport_name            sport_abbreviation sort_order active
        1   mlb            /api/v1/sports/1      Major League Baseball MLB                        11 TRU
mlb_sports_info                                                                                171
      11    aaa            /api/v1/sports/11     Triple-A                              AAA          101 TRU
      12    aax            /api/v1/sports/12     Double-A                              AA           201 TRU
      13    afa            /api/v1/sports/13     High-A                                A+           301 TRU
      14    afx            /api/v1/sports/14     Low-A                                 A            401 TRU
      16    rok            /api/v1/sports/16     Rookie                                ROK          701 TRU
      17    win            /api/v1/sports/17     Winter Leagues                        WIN         1301 TRU
       8    bbl            /api/v1/sports/8      Organized Baseball                    Pros        1401 TRU
      21    min            /api/v1/sports/21     Minor League Baseball                 Minors      1402 TRU
      23    ind            /api/v1/sports/23     Independent Leagues                   IND         2101 TRU
      51    int            /api/v1/sports/51     International Baseball                INT         3501 TRU
     508    nat            /api/v1/sports/508    International Baseball (Collegiate)   INTC        3502 TRU
     509    nae            /api/v1/sports/509    International Baseball (18 and under) 18U         3503 TRU
     510    nas            /api/v1/sports/510    International Baseball (16 and under) 16U         3505 TRU
      22    bbc            /api/v1/sports/22     College Baseball                      College     5101 TRU
     586    hsb            /api/v1/sports/586    High School Baseball                  H.S.        6201 TRU
Examples
      try(mlb_sports())
  mlb_sports_info               MLB Sport IDs Information
Description
    MLB Sport IDs Information
Usage
    mlb_sports_info(sport_id = 1)
Arguments
    sport_id            The sport_id to return information for.
Value
    Returns a tibble with the following columns
                                     col_name               types
                                      sport_id              integer
                                      sport_code            character
                                      sport_link            character
                                      sport_name            character
                                      sport_abbreviation    character
172                                                                       mlb_sports_players
                                      sort_order          integer
                                      active_status       logical
Examples
      try(mlb_sports_info(sport_id = 1))
  mlb_sports_players            MLB Sport Players
Description
    MLB Sport Players
Usage
    mlb_sports_players(sport_id = 1, season = 2021)
Arguments
    sport_id            The sport_id to return information for.
    season              The season to return information for.
Value
    Returns a tibble with the following columns:
                              col_name                          types
                               player_id                        integer
                               full_name                        character
                               link                             character
                               first_name                       character
                               last_name                        character
                               primary_number                   character
                               birth_date                       character
                               current_age                      integer
                               birth_city                       character
                               birth_country                    character
                               height                           character
                               weight                           integer
                               active                           logical
                               use_name                         character
                               middle_name                      character
                               boxscore_name                    character
mlb_standings                                                      173
                           nick_name                     character
                           gender                        character
                           is_player                     logical
                           is_verified                   logical
                           pronunciation                 character
                           mlb_debut_date                character
                           name_first_last               character
                           name_slug                     character
                           first_last_name               character
                           last_first_name               character
                           last_init_name                character
                           init_last_name                character
                           full_fml_name                 character
                           full_lfm_name                 character
                           strike_zone_top               numeric
                           strike_zone_bottom            numeric
                           birth_state_province          character
                           draft_year                    integer
                           name_matrilineal              character
                           name_title                    character
                           last_played_date              character
                           current_team_id               integer
                           current_team_name             character
                           current_team_link             character
                           primary_position_code         character
                           primary_position_name         character
                           primary_position_type         character
                           primary_position_abbreviation character
                           bat_side_code                 character
                           bat_side_description          character
                           pitch_hand_code               character
                           pitch_hand_description        character
Examples
      try(mlb_sports_players(sport_id = 1, season = 2021))
  mlb_standings             MLB Standings
Description
    MLB Standings
174                                                                                       mlb_standings
Usage
    mlb_standings(
      season = NULL,
      date = NULL,
      standings_type = NULL,
      league_id = NULL
    )
Arguments
    season              Year(s) to return to return standings information for.
    date                Date to return to return standings information for.
    standings_type The standings_type(s) to return standings information for. Description of all
                        standings_types
                          1. regularSeason - Regular Season Standings
                          2. wildCard - Wild card standings
                          3. divisionLeaders - Division Leader standings
                          4. wildCardWithLeaders - Wild card standings with Division Leaders
                          5. firstHalf - First half standings. Only valid for leagues with a split season
                             (Mexican League).
                          6. secondHalf - Second half standings. Only valid for leagues with a split
                             season (Mexican League).
                          7. springTraining - Spring Training Standings
                          8. postseason - Postseason Standings
                          9. byDivision - Standings by Division
                         10. byConference - Standings by Conference
                         11. byLeague - Standings by League
    league_id           The league_id(s) to return standings information for.
Value
    Returns a tibble with the following columns
                      col_name                                            types
                       standings_type                                     character
                       last_updated                                       character
                       team_records_season                                character
                       team_records_clinch_indicator                      character
                       team_records_division_rank                         character
                       team_records_league_rank                           character
                       team_records_sport_rank                            character
                       team_records_games_played                          integer
                       team_records_games_back                            character
                       team_records_wild_card_games_back                  character
                       team_records_league_games_back                     character
                       team_records_spring_league_games_back              character
mlb_standings                                                           175
                    team_records_sport_games_back             character
                    team_records_division_games_back          character
                    team_records_conference_games_back        character
                    team_records_last_updated                 character
                    team_records_runs_allowed                 integer
                    team_records_runs_scored                  integer
                    team_records_division_champ               logical
                    team_records_division_leader              logical
                    team_records_has_wildcard                 logical
                    team_records_clinched                     logical
                    team_records_elimination_number           character
                    team_records_wild_card_elimination_number character
                    team_records_magic_number                 character
                    team_records_wins                         integer
                    team_records_losses                       integer
                    team_records_run_differential             integer
                    team_records_winning_percentage           character
                    team_records_wild_card_rank               character
                    team_records_wild_card_leader             logical
                    team_records_team_id                      integer
                    team_records_team_name                    character
                    team_records_team_link                    character
                    team_records_streak_streak_type           character
                    team_records_streak_streak_number         integer
                    team_records_streak_streak_code           character
                    team_records_league_record_wins           integer
                    team_records_league_record_losses         integer
                    team_records_league_record_ties           integer
                    team_records_league_record_pct            character
                    team_records_records_split_records        list
                    team_records_records_division_records     list
                    team_records_records_overall_records      list
                    team_records_records_league_records       list
                    team_records_records_expected_records     list
                    league_id                                 integer
                    league_link                               character
                    division_id                               integer
                    division_link                             character
                    sport_id                                  integer
                    sport_link                                character
Examples
      try(mlb_standings(season = 2021, league_id = 103))
176                                                                   mlb_stats
  mlb_standings_types          MLB Standings Types
Description
    MLB Standings Types
Usage
    mlb_standings_types()
Value
    Returns a tibble with the following columns
                                col_name                    types
                                 standings_type_name        character
                                 standings_type_description character
Examples
      try(mlb_standings_types())
  mlb_stats                    MLB Stats
Description
    MLB Stats
Usage
    mlb_stats(
      stat_type = NULL,
      player_pool = NULL,
      game_type = NULL,
      team_id = NULL,
      position = NULL,
      stat_group = NULL,
      season = NULL,
      league_id = NULL,
      sport_ids = NULL,
      sort_stat = NULL,
mlb_stats                                                                                        177
      order = NULL,
      limit = 1000,
      offset = NULL
    )
Arguments
    stat_type       Stat type to return statistics for.
    player_pool     There are 4 different types of player pools to return statistics for a particular
                    player pool across a sport. Acceptable values include: All, Qualified, Rookies,
                    or Qualified_rookies
    game_type       Game type to return information for a particular statistic in a particular game
                    type.
    team_id         Team ID to return information and ranking for a particular statistic for a partic-
                    ular team.
    position        Position to return statistics for a given position. Default to "Qualified" player
                    pool Acceptable values include:
                       • P
                       • C
                       • 1B
                       • 2B
                       • 3B
                       • SS
                       • LF
                       • CF
                       • RF
                       • DH
                       • PH
                       • PR
                       • BR
                       • OF
                       • IF
                       • SP
                       • RP
                       • CP
                       • UT
                       • UI
                       • UO
                       • RHP
                       • LHP
                       • RHS
                       • LHS
                       • LHR
178                                                                                               mlb_stats
                           • RHR
                           • B
                           • X
    stat_group          Stat group to return information and ranking for a particular statistic in a partic-
                        ular group.
    season              Year to return information and ranking for a particular statistic in a given year.
    league_id           League ID to return statistics for a given league. Default to "Qualified" player
                        pool.
    sport_ids           The sport_id(s) to return information and ranking information for.
    sort_stat           Sort return based on stat.
    order               Order return based on either desc or asc.
    limit               A limit to limit return to a particular number of records.
    offset              An offset to returns i+1 as the first record in the set of players.
Value
    Returns a tibble with the following columns
                                 col_name                        types
                                  total_splits                   integer
                                  season                         character
                                  num_teams                      integer
                                  rank                           integer
                                  games_played                   integer
                                  ground_outs                    integer
                                  air_outs                       integer
                                  runs                           integer
                                  doubles                        integer
                                  triples                        integer
                                  home_runs                      integer
                                  strike_outs                    integer
                                  base_on_balls                  integer
                                  intentional_walks              integer
                                  hits                           integer
                                  hit_by_pitch                   integer
                                  avg                            character
                                  at_bats                        integer
                                  obp                            character
                                  slg                            character
                                  ops                            character
                                  caught_stealing                integer
                                  stolen_bases                   integer
                                  stolen_base_percentage         character
                                  ground_into_double_play        integer
                                  number_of_pitches              integer
                                  plate_appearances              integer
mlb_stats_leaders                                                                 179
                             total_bases               integer
                             rbi                       integer
                             left_on_base              integer
                             sac_bunts                 integer
                             sac_flies                 integer
                             babip                     character
                             ground_outs_to_airouts    character
                             catchers_interference     integer
                             at_bats_per_home_run      character
                             team_id                   integer
                             team_name                 character
                             team_link                 character
                             player_id                 integer
                             player_full_name          character
                             player_link               character
                             player_first_name         character
                             player_last_name          character
                             league_id                 integer
                             league_name               character
                             league_link               character
                             sport_id                  integer
                             sport_link                character
                             sport_abbreviation        character
                             position_code             character
                             position_name             character
                             position_type             character
                             position_abbreviation     character
                             splits_tied_with_offset   list
                             splits_tied_with_limit    list
                             player_pool               character
                             type_display_name         character
                             group_display_name        character
Examples
      try(mlb_stats(stat_type = 'season', stat_group = 'hitting', season = 2021))
  mlb_stats_leaders        MLB Stats Leaders
Description
    MLB Stats Leaders
180                                                                               mlb_stats_leaders
Usage
    mlb_stats_leaders(
      leader_categories = NULL,
      player_pool = NULL,
      leader_game_types = NULL,
      sit_codes = NULL,
      position = NULL,
      stat_group = NULL,
      season = NULL,
      league_id = NULL,
      sport_id = NULL,
      start_date = NULL,
      end_date = NULL,
      stat_type = NULL,
      limit = 1000
    )
Arguments
    leader_categories
                   League leader category to return information and ranking for a particular statis-
                   tic.
    player_pool    There are 4 different types of player pools to return statistics for a particular
                   player pool across a sport. Acceptable values include: All, Qualified, Rookies,
                   or Qualified_rookies
    leader_game_types
                   Game type to return information and ranking for a particular statistic in a partic-
                   ular game type.
    sit_codes      Situation code to return information and ranking for a particular statistic in a
                   particular game type.
    position       Position to return statistics for a given position. Default to "Qualified" player
                   pool Acceptable values include:
                      • P
                      • C
                      • 1B
                      • 2B
                      • 3B
                      • SS
                      • LF
                      • CF
                      • RF
                      • DH
                      • PH
                      • PR
                      • BR
mlb_stats_leaders                                                                                      181
                           • OF
                           • IF
                           • SP
                           • RP
                           • CP
                           • UT
                           • UI
                           • UO
                           • RHP
                           • LHP
                           • RHS
                           • LHS
                           • LHR
                           • RHR
                           • B
                           • X
    stat_group          Stat group to return information and ranking for a particular statistic in a partic-
                        ular group.
    season              Year to return information and ranking for a particular statistic in a given year.
    league_id           League ID to return statistics for a given league. Default to "Qualified" player
                        pool.
    sport_id            The sport_id to return information and ranking information for.
    start_date          Start date to return information and ranking for a particular statistic for a par-
                        ticular date range. Format: MM/DD/YYYY start_date must be coupled with
                        end_date and byDateRange stat_type
    end_date            End date to return information and ranking for a particular statistic for a par-
                        ticular date range. Format: MM/DD/YYYY end_date must be coupled with
                        start_date and byDateRange stat_type
    stat_type           The stat_type to return information and ranking for a particular statistic for a
                        particular stat type.
    limit               A limit to limit return to a particular number of records.
Value
    Returns a tibble with the following columns
                                  col_name                      types
                                   leader_category              character
                                   rank                         integer
                                   value                        character
                                   season                       character
                                   num_teams                    integer
                                   team_id                      integer
                                   team_name                    character
182                                                                          mlb_stat_groups
                                   team_link               character
                                   league_id               integer
                                   league_name             character
                                   league_link             character
                                   person_id               integer
                                   person_full_name        character
                                   person_link             character
                                   person_first_name       character
                                   person_last_name        character
                                   sport_id                integer
                                   sport_link              character
                                   sport_abbreviation      character
                                   stat_group              character
                                   total_splits            integer
                                   game_type_id            character
                                   game_type_description   character
Examples
     try(mlb_stats_leaders(leader_categories='homeRuns',sport_id=1, season = 2021))
  mlb_stat_groups              MLB Stat Groups
Description
    MLB Stat Groups
Usage
    mlb_stat_groups()
Value
    Returns a tibble with the following columns
                                      col_name          types
                                       stat_group_name  character
Examples
      try(mlb_stat_groups())
mlb_teams                                                      183
  mlb_stat_types               MLB Stat Types
Description
    MLB Stat Types
Usage
    mlb_stat_types()
Value
    Returns a tibble with the following columns
                                     col_name        types
                                      stat_type_name character
Examples
      try(mlb_stat_types())
  mlb_teams                    MLB Teams
Description
    MLB Teams
Usage
    mlb_teams(
      season = NULL,
      active_status = NULL,
      all_star_statuses = NULL,
      league_ids = NULL,
      sport_ids = NULL,
      game_type = NULL
    )
184                                                                                 mlb_teams
Arguments
    season              Year to return to return team information for.
    active_status The active statuses to populate teams for a given season.
    all_star_statuses
                        The all-star statuses to populate teams for a given season.
    league_ids          The league_id(s) to return team information for.
    sport_ids           The sport_id(s) to return team information for.
    game_type           The game_type to return team information for.
Value
    Returns a tibble with the following columns
                                col_name                        types
                                 team_id                        integer
                                 team_full_name                 character
                                 link                           character
                                 season                         integer
                                 team_code                      character
                                 file_code                      character
                                 team_abbreviation              character
                                 team_name                      character
                                 location_name                  character
                                 first_year_of_play             character
                                 short_name                     character
                                 franchise_name                 character
                                 club_name                      character
                                 all_star_status                character
                                 active                         logical
                                 venue_id                       integer
                                 venue_name                     character
                                 venue_link                     character
                                 spring_venue_id                integer
                                 spring_venue_link              character
                                 league_id                      integer
                                 league_name                    character
                                 league_link                    character
                                 division_id                    integer
                                 division_name                  character
                                 division_link                  character
                                 sport_id                       integer
                                 sport_link                     character
                                 sport_name                     character
                                 spring_league_id               integer
                                 spring_league_name             character
                                 spring_league_link             character
                                 spring_league_abbreviation     character
mlb_teams_stats                                                                                        185
Examples
      try(mlb_teams(season = 2021, sport_ids = c(1)))
  mlb_teams_stats               MLB Teams Stats
Description
    MLB Teams Stats
Usage
    mlb_teams_stats(
      stat_type = NULL,
      game_type = NULL,
      stat_group = NULL,
      season = NULL,
      sport_ids = NULL,
      sort_stat = NULL,
      order = NULL
    )
Arguments
    stat_type           Stat type to return statistics for.
    game_type           Game type to return information for a particular statistic in a particular game
                        type.
    stat_group          Stat group to return information and ranking for a particular statistic in a partic-
                        ular group.
    season              Year to return information and ranking for a particular statistic in a given year.
    sport_ids           The sport_id(s) to return information and ranking information for.
    sort_stat           Sort return based on stat.
    order               Order return based on either desc or asc.
Value
    Returns a tibble with the following columns
                                 col_name                     types
                                  total_splits                integer
                                  season                      character
                                  rank                        integer
                                  games_played                integer
186                                                                        mlb_teams_stats
                           ground_outs               integer
                           air_outs                  integer
                           runs                      integer
                           doubles                   integer
                           triples                   integer
                           home_runs                 integer
                           strike_outs               integer
                           base_on_balls             integer
                           intentional_walks         integer
                           hits                      integer
                           hit_by_pitch              integer
                           avg                       character
                           at_bats                   integer
                           obp                       character
                           slg                       character
                           ops                       character
                           caught_stealing           integer
                           stolen_bases              integer
                           stolen_base_percentage    character
                           ground_into_double_play   integer
                           number_of_pitches         integer
                           plate_appearances         integer
                           total_bases               integer
                           rbi                       integer
                           left_on_base              integer
                           sac_bunts                 integer
                           sac_flies                 integer
                           babip                     character
                           ground_outs_to_airouts    character
                           catchers_interference     integer
                           at_bats_per_home_run      character
                           team_id                   integer
                           team_name                 character
                           team_link                 character
                           splits_tied_with_offset   list
                           splits_tied_with_limit    list
                           type_display_name         character
                           group_display_name        character
Examples
    try(mlb_teams_stats(stat_type = 'season', stat_group = 'hitting', season = 2021))
mlb_teams_stats_leaders                                                                              187
  mlb_teams_stats_leaders
                              MLB Teams Stats Leaders
Description
    MLB Teams Stats Leaders
Usage
    mlb_teams_stats_leaders(
      leader_categories = NULL,
      leader_game_types = NULL,
      sit_codes = NULL,
      stat_group = NULL,
      season = NULL,
      league_id = NULL,
      sport_id = NULL,
      start_date = NULL,
      end_date = NULL,
      stat_type = NULL,
      limit = 1000
    )
Arguments
    leader_categories
                      League leader category to return information and ranking for a particular statis-
                      tic.
    leader_game_types
                      Game type to return information and ranking for a particular statistic in a partic-
                      ular game type.
    sit_codes         Situation code to return information and ranking for a particular statistic in a
                      particular game type.
    stat_group        Stat group to return information and ranking for a particular statistic in a partic-
                      ular group.
    season            Year to return information and ranking for a particular statistic in a given year.
    league_id         League ID to return statistics for a given league. Default to "Qualified" player
                      pool.
    sport_id          The sport_id to return information and ranking information for.
    start_date        Start date to return information and ranking for a particular statistic for a par-
                      ticular date range. Format: MM/DD/YYYY start_date must be coupled with
                      end_date and byDateRange stat_type
    end_date          End date to return information and ranking for a particular statistic for a par-
                      ticular date range. Format: MM/DD/YYYY end_date must be coupled with
                      start_date and byDateRange stat_type
188                                                                                mlb_team_affiliates
    stat_type           The stat_type to return information and ranking for a particular statistic for a
                        particular stat type.
    limit               A limit to limit return to a particular number of records.
Value
    Returns a tibble with the following columns
                                  col_name                      types
                                   leader_category              character
                                   rank                         integer
                                   value                        character
                                   season                       character
                                   num_teams                    integer
                                   team_id                      integer
                                   team_name                    character
                                   team_link                    character
                                   league_id                    integer
                                   league_name                  character
                                   league_link                  character
                                   person_id                    integer
                                   person_full_name             character
                                   person_link                  character
                                   person_first_name            character
                                   person_last_name             character
                                   sport_id                     integer
                                   sport_link                   character
                                   sport_abbreviation           character
                                   stat_group                   character
                                   total_splits                 integer
                                   game_type_id                 character
                                   game_type_description        character
Examples
     try(mlb_teams_stats_leaders(leader_categories='homeRuns',sport_id=1, season = 2021))
  mlb_team_affiliates          MLB Team Affiliates
Description
    MLB Team Affiliates
mlb_team_affiliates                                                                          189
Usage
    mlb_team_affiliates(team_ids = NULL, sport_ids = NULL, season = NULL)
Arguments
    team_ids            The team_id(s) to return affiliates data for.
    sport_ids           The sport_id to return team affiliates information for.
    season              The season to return team affiliates data for the particular season.
Value
    Returns a tibble with the following columns
                                col_name                         types
                                 all_star_status                 character
                                 team_id                         integer
                                 team_full_name                  character
                                 link                            character
                                 season                          integer
                                 team_code                       character
                                 file_code                       character
                                 team_abbreviation               character
                                 team_name                       character
                                 location_name                   character
                                 first_year_of_play              character
                                 short_name                      character
                                 franchise_name                  character
                                 club_name                       character
                                 active                          logical
                                 parent_org_name                 character
                                 parent_org_id                   integer
                                 spring_league_id                integer
                                 spring_league_name              character
                                 spring_league_link              character
                                 spring_league_abbreviation      character
                                 venue_id                        integer
                                 venue_name                      character
                                 venue_link                      character
                                 spring_venue_id                 integer
                                 spring_venue_link               character
                                 league_id                       integer
                                 league_name                     character
                                 league_link                     character
                                 division_id                     integer
                                 division_name                   character
                                 division_link                   character
                                 sport_id                        integer
                                 sport_link                      character
190                                                                                     mlb_team_alumni
                                  sport_name                   character
Examples
      try(mlb_team_affiliates(team_ids = 147))
  mlb_team_alumni                MLB Team Alumni
Description
    MLB Team Alumni
Usage
    mlb_team_alumni(team_id = NULL, stat_group = NULL, season = NULL)
Arguments
    team_id             Team ID to return information and ranking for a particular statistic for a partic-
                        ular team.
    stat_group          Stat group to return information and ranking for a particular statistic in a partic-
                        ular group.
    season              Year to return information and ranking for a particular statistic in a given year.
Value
    Returns a tibble with the following columns
                               col_name                         types
                                player_id                       integer
                                player_full_name                character
                                link                            character
                                first_name                      character
                                last_name                       character
                                primary_number                  character
                                birth_date                      character
                                current_age                     integer
                                birth_city                      character
                                birth_country                   character
                                height                          character
                                weight                          integer
                                active                          logical
                                use_name                        character
mlb_team_coaches                                                                 191
                           middle_name                   character
                           boxscore_name                 character
                           nick_name                     character
                           gender                        character
                           name_matrilineal              character
                           is_player                     logical
                           is_verified                   logical
                           pronunciation                 character
                           mlb_debut_date                character
                           name_first_last               character
                           name_slug                     character
                           first_last_name               character
                           last_first_name               character
                           last_init_name                character
                           init_last_name                character
                           full_fml_name                 character
                           full_lfm_name                 character
                           strike_zone_top               numeric
                           strike_zone_bottom            numeric
                           alumni_last_season            character
                           birth_state_province          character
                           draft_year                    integer
                           primary_position_code         character
                           primary_position_name         character
                           primary_position_type         character
                           primary_position_abbreviation character
                           bat_side_code                 character
                           bat_side_description          character
                           pitch_hand_code               character
                           pitch_hand_description        character
Examples
      try(mlb_team_alumni(team_id = 137, stat_group = 'hitting', season = 2021))
  mlb_team_coaches          MLB Team Coaches
Description
    MLB Team Coaches
Usage
    mlb_team_coaches(team_id = NULL, date = NULL, season = NULL)
192                                                                                    mlb_team_history
Arguments
    team_id             Team ID to return team coach information for.
    date                Date to return team coach information for.
    season              Year to return team coach information for.
Value
    Returns a tibble with the following columns
                                     col_name              types
                                      jersey_number        character
                                      job                  character
                                      job_id               character
                                      title                character
                                      person_id            integer
                                      person_full_name     character
                                      person_link          character
Examples
      try(mlb_team_coaches(team_id = 137, season = 2021))
  mlb_team_history             MLB Teams History
Description
    MLB Teams History
Usage
    mlb_team_history(team_ids = NULL, start_season = NULL, end_season = NULL)
Arguments
    team_ids            The team_id(s) to return historical data for.
    start_season        The start_season to return historical data for from the given year to present.
    end_season          The end_season to return historical data for from the the creation to the given
                        year.
Value
    Returns a tibble with the following columns
mlb_team_info                                                     193
                                col_name            types
                                 all_star_status    character
                                 team_id            integer
                                 team_full_name     character
                                 link               character
                                 season             integer
                                 team_code          character
                                 file_code          character
                                 team_abbreviation  character
                                 team_name          character
                                 location_name      character
                                 first_year_of_play character
                                 short_name         character
                                 franchise_name     character
                                 club_name          character
                                 active             logical
                                 venue_id           integer
                                 venue_name         character
                                 venue_link         character
                                 spring_venue_id    integer
                                 spring_venue_link  character
                                 league_id          integer
                                 league_name        character
                                 league_link        character
                                 sport_id           integer
                                 sport_link         character
                                 sport_name         character
Examples
      try(mlb_team_history(team_ids = 147))
  mlb_team_info            MLB Team Info
Description
    MLB Team Info
Usage
    mlb_team_info(team_id = NULL, season = NULL, sport_id = NULL)
194                                                                                    mlb_team_leaders
Arguments
    team_id             The team_id to return team data for.
    season              The season to return team data for the given year.
    sport_id            The sport_id to return a directory of team data for a particular club in a sport.
Value
    Returns a tibble with the following columns
                                    col_name               types
                                     all_star_status       character
                                     team_id               integer
                                     team_full_name        character
                                     link                  character
                                     season                integer
                                     team_code             character
                                     file_code             character
                                     team_abbreviation     character
                                     team_name             character
                                     location_name         character
                                     first_year_of_play    character
                                     short_name            character
                                     franchise_name        character
                                     club_name             character
                                     active                logical
                                     venue_id              integer
                                     venue_name            character
                                     venue_link            character
                                     spring_venue_id       integer
                                     spring_venue_link     character
                                     league_id             integer
                                     league_name           character
                                     league_link           character
                                     sport_id              integer
                                     sport_link            character
                                     sport_name            character
Examples
      try(mlb_team_info(team_id = 147))
  mlb_team_leaders             MLB Team Leaders
mlb_team_leaders                                                                                      195
Description
    MLB Team Leaders
Usage
    mlb_team_leaders(
      team_id = NULL,
      leader_categories = NULL,
      leader_game_types = NULL,
      season = NULL,
      limit = 1000
    )
Arguments
    team_id             Team ID to return team leader information for.
    leader_categories
                        Team leader category to return information and ranking for a particular statistic.
    leader_game_types
                        Game type to return information and ranking for a particular statistic in a partic-
                        ular game type.
    season              Season to return team leader information for.
    limit               A limit to limit return to a particular number of records.
Value
    Returns a tibble with the following columns
                                  col_name                      types
                                   leader_category              character
                                   rank                         integer
                                   value                        character
                                   season                       character
                                   team_id                      integer
                                   team_name                    character
                                   team_link                    character
                                   league_id                    integer
                                   league_name                  character
                                   league_link                  character
                                   person_id                    integer
                                   person_full_name             character
                                   person_link                  character
                                   person_first_name            character
                                   person_last_name             character
                                   sport_id                     integer
                                   sport_link                   character
                                   sport_abbreviation           character
                                   stat_group                   character
196                                                                      mlb_team_personnel
                                   total_splits             integer
                                   game_type_id             character
                                   game_type_description    character
Examples
      try(mlb_team_leaders(team_id = 137, leader_categories = "homeRuns", season = 2021))
  mlb_team_personnel           MLB Team Personnel
Description
    MLB Team Personnel
Usage
    mlb_team_personnel(team_id = NULL, date = NULL)
Arguments
    team_id             Team ID to return team coach information for.
    date                Date to return team coach information for.
Value
    Returns a tibble with the following columns
                                     col_name            types
                                      jersey_number      character
                                      job                character
                                      job_id             character
                                      title              character
                                      person_id          integer
                                      person_full_name   character
                                      person_link        character
Examples
      try(mlb_team_personnel(team_id = 137, date = "08/28/2016"))
mlb_team_stats                                                                                         197
  mlb_team_stats                MLB Team Individual Stats
Description
    MLB Team Individual Stats
Usage
    mlb_team_stats(
      team_id = NULL,
      stat_type = NULL,
      game_type = NULL,
      stat_group = NULL,
      season = NULL,
      sport_ids = NULL
    )
Arguments
    team_id             Team ID to return information and ranking for a particular statistic for a partic-
                        ular team.
    stat_type           Stat type to return statistics for.
    game_type           Game type to return information for a particular statistic in a particular game
                        type.
    stat_group          Stat group to return information and ranking for a particular statistic in a partic-
                        ular group.
    season              Year to return information and ranking for a particular statistic in a given year.
    sport_ids           The sport_id(s) to return information and ranking information for.
Value
    Returns a tibble with the following columns
                                 col_name                     types
                                  season                      character
                                  games_played                integer
                                  ground_outs                 integer
                                  air_outs                    integer
                                  runs                        integer
                                  doubles                     integer
                                  triples                     integer
                                  home_runs                   integer
                                  strike_outs                 integer
                                  base_on_balls               integer
                                  intentional_walks           integer
198                                                                                mlb_venues
                             hits                       integer
                             hit_by_pitch               integer
                             avg                        character
                             at_bats                    integer
                             obp                        character
                             slg                        character
                             ops                        character
                             caught_stealing            integer
                             stolen_bases               integer
                             stolen_base_percentage     character
                             ground_into_double_play    integer
                             number_of_pitches          integer
                             plate_appearances          integer
                             total_bases                integer
                             rbi                        integer
                             left_on_base               integer
                             sac_bunts                  integer
                             sac_flies                  integer
                             babip                      character
                             ground_outs_to_airouts     character
                             catchers_interference      integer
                             at_bats_per_home_run       character
                             team_id                    integer
                             team_name                  character
                             team_link                  character
                             type_display_name          character
                             group_display_name         character
Examples
     try(mlb_team_stats(team_id = 137, stat_type = 'season', stat_group = 'hitting', season = 2021))
  mlb_venues               Find MLB Venues
Description
    Find MLB Venues
Usage
    mlb_venues(venue_ids = NULL, sport_ids = NULL, season = NULL)
mlb_wind_direction_codes                                                                           199
Arguments
    venue_ids           Venue directorial information based venue_id.
    sport_ids           The sport_id(s) for which to return venue directorial information.
    season              Year for which to return venue directorial information for a given season.
Value
    Returns a tibble with the following columns:
                                       col_name         types
                                        venue_id        integer
                                        venue_name      character
                                        venue_link      character
                                        active          logical
                                        season          logical
Examples
      try(mlb_venues())
      try(mlb_venues(venue_ids = 4781))
      try(mlb_venues(sport_ids = 1))
  mlb_wind_direction_codes
                               MLB Wind Direction Codes
Description
    MLB Wind Direction Codes
Usage
    mlb_wind_direction_codes()
Value
    Returns a tibble with the following columns
                                col_name                        types
                                 wind_direction_code            character
                                 wind_direction_description     character
200                                                                most_recent_ncaa_baseball_season
Examples
      try(mlb_wind_direction_codes())
  most_recent_mlb_season
                               Most Recent MLB Season
Description
    Most Recent MLB Season
Usage
    most_recent_mlb_season()
Value
    An integer indicating the year of the most recent season of Major League Baseball
  most_recent_ncaa_baseball_season
                               Most Recent NCAA Baseball Season
Description
    Most Recent NCAA Baseball Season
Usage
    most_recent_ncaa_baseball_season()
Value
    An integer indicating the year of the most recent season of NCAA baseball
ncaa                                                                                                     201
  ncaa                           NCAA Functions Overview
Description
    ncaa_team_player_stats(): This function allows the user to obtain batting or pitching statistics
          for any school affiliated with the NCAA at the division I, II, or III levels. The function acquires
          data from the NCAA’s website (stats.ncaa.org) and returns a tibble.
    ncaa_pbp(): Get Play-By-Play Data for NCAA Baseball Games.
    ncaa_roster(): Get NCAA Baseball Rosters.
    ncaa_game_logs(): Get NCAA Baseball Game Logs.
    ncaa_lineups(): Get NCAA Baseball Game Lineups.
    ncaa_park_factor(): Get Park Effects for NCAA Baseball Teams.
    ncaa_schedule_info(): Get Schedule and Results for NCAA Baseball Teams.
    ncaa_school_id_lu(): Lookup NCAA School IDs (Division I, II, and III)
    ncaa_teams(): Lookup NCAA Teams by Division (I, II, and III) and Season
Details
      Scrape NCAA baseball data (Division I, II, and III):
         ncaa_team_player_stats(team_id = 255, year = 2013, type = "batting")
      Get Play-By-Play Data for NCAA Baseball Games:
         x <- ncaa_schedule_info(736, 2021)$game_info_url[2]
         ncaa_pbp(game_info_url = x)
      Get NCAA Baseball Rosters:
         ncaa_roster(team_id = 104, year = 2021)
      Get NCAA Baseball Game Logs:
        ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span = "game")
      Get NCAA Baseball Game Lineups:
        ncaa_lineups(game_info_url="https://stats.ncaa.org/game/index/4587474?org_id=528",year=2018)
      Get Park Effects for NCAA Baseball Teams:
          ncaa_park_factor(team_id = 736, years = c(2017:2019), type = "conference")
      Get Schedule and Results for NCAA Baseball Teams:
         ncaa_schedule_info(team_id = 736, year = 2021)
202                                                                                   ncaa_game_logs
      Lookup NCAA School IDs (Division I, II, and III):
        ncaa_school_id_lu("VAN")
      Scrape NCAA baseball Teams (Division I, II, and III):
        ncaa_teams(year = 2023, division = 1)
  ncaa_baseball_roster        (legacy) Get NCAA Baseball Rosters
Description
    (legacy) Get NCAA Baseball Rosters
    (legacy) Get NCAA Baseball Rosters
Usage
    ncaa_baseball_roster(team_id = NULL, year, ...)
    get_ncaa_baseball_roster(team_id = NULL, year, ...)
Arguments
    team_id           NCAA id for a school
    year              The year of interest
    ...               Additional arguments passed to an underlying function like httr.
Value
    A data frame containing roster information, including IDs and urls for each player (if available)
    A data frame containing roster information, including IDs and urls for each player (if available)
  ncaa_game_logs              Get NCAA Baseball Game Logs
Description
    Get NCAA Baseball Game Logs
Usage
    ncaa_game_logs(player_id, year, type = "batting", span = "game", ...)
ncaa_game_logs                                                                                       203
Arguments
    player_id         A player’s unique id. Can be found using the get_ncaa_baseball_roster function.
    year              The year of interest.
    type              The kind of statistics you want to return. Current options are ’batting’ or ’pitch-
                      ing’.
    span              The span of time; can either be ’game’ for game logs in a season, or ’career’
                      which returns seasonal stats for a player’s career.
    ...               Additional arguments passed to an underlying function like httr.
Value
    A data frame containing player and school information as well as game by game statistics
                                     col_name          types
                                      player_id        numeric
                                      player_name      character
                                      Date             character
                                      Opponent         character
                                      Result           character
                                      App              numeric
                                      G                numeric
                                      GS               numeric
                                      IP               numeric
                                      CG               numeric
                                      H                numeric
                                      R                numeric
                                      ER               numeric
                                      BB               numeric
                                      SO               numeric
                                      SHO              numeric
                                      BF               numeric
                                      P-OAB            numeric
                                      2B-A             numeric
                                      3B-A             numeric
                                      Bk               numeric
                                      HR-A             numeric
                                      WP               numeric
                                      HB               numeric
                                      IBB              numeric
                                      Inh Run          numeric
                                      Inh Run Score    numeric
                                      SHA              numeric
                                      SFA              numeric
                                      Pitches          numeric
                                      GO               numeric
                                      FO               numeric
                                      W                numeric
204                                                                                      ncaa_lineups
                                       L                 numeric
                                       SV                numeric
                                       OrdAppeared       numeric
                                       KL                numeric
                                       pickoffs          character
Examples
      try(ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span         = "game"))
      try(ncaa_game_logs(player_id = 2113782, year = 2021, type = "pitching", span =      "career"))
      try(ncaa_game_logs(player_id = 1879650, year = 2019, type = "batting", span          = "game"))
      try(ncaa_game_logs(player_id = 1879650, year = 2019, type = "batting", span =       "career"))
  ncaa_lineups                 Retrieve lineups for a given NCAA game via its game_info_url
Description
    Retrieve lineups for a given NCAA game via its game_info_url
Usage
    ncaa_lineups(game_info_url = NULL, ...)
Arguments
    game_info_url       The unique game info url
    ...                 Additional arguments passed to an underlying function like httr.
Value
    Returns a tibble of each school’s starting lineup and starting pitcher
                                      col_name           types
                                       year              numeric
                                       player_name       character
                                       position          character
                                       slug              character
                                       batting_order     character
                                       team_name         character
                                       sub               numeric
                                       attendance        character
                                       game_date         character
                                       location          character
                                       player_id         integer
ncaa_park_factor                                                                                   205
                                       team_id           numeric
                                       team_url          character
                                       conference_id     numeric
                                       conference        character
                                       division          numeric
                                       season_id         numeric
Examples
       try(ncaa_lineups(game_info_url="https://stats.ncaa.org/contests/2167178/box_score"))
      try(ncaa_lineups(game_info_url="https://stats.ncaa.org/game/index/4587474?org_id=528"))
  ncaa_park_factor             Get Park Effects for NCAA Baseball Teams
Description
    Get Park Effects for NCAA Baseball Teams
Usage
    ncaa_park_factor(team_id, years, type = "conference", ...)
Arguments
    team_id             The team’s unique NCAA id.
    years               The season or seasons (i.e. use 2016 for the 2015-2016 season, etc., limited to
                        just 2013-2020 seasons).
    type                default is conference. the conference parameter adjusts for the conference the
                        school plays in, the division parameter calculates based on the division the
                        school plays in 1,2,or 3. Defaults to ’conference’.
    ...                 Additional arguments passed to an underlying function like httr.
Details
      try(ncaa_park_factor(team_id = 736, years = c(2018:2019), type = "conference"))
Value
    A data frame with the following fields: school, home_game, away_game, runs_scored_home,
    runs_allowed_home, run_scored_away, runs_allowed_away, base_pf (base park factor), home_game_adj
    (an adjustment for the percentage of home games played) final_pf (park factor after adjustments)
                                    col_name                 types
206                                                                                         ncaa_pbp
                                  school                  character
                                  home_game               numeric
                                  away_game               numeric
                                  runs_scored_home        numeric
                                  runs_allowed_home       numeric
                                  runs_scored_away        numeric
                                  runs_allowed_away       numeric
                                  base_pf                 numeric
                                  home_game_adj           numeric
                                  final_pf                numeric
  ncaa_pbp                  Get Play-By-Play Data for NCAA Baseball Games
Description
    Get Play-By-Play Data for NCAA Baseball Games
Usage
    ncaa_pbp(
      game_info_url = NA_character_,
      game_pbp_url = NA_character_,
      raw_html_to_disk = FALSE,
      raw_html_path = "/",
      read_from_file = FALSE,
      file = NA_character_,
      ...
    )
Arguments
    game_info_url    The url for the game’s boxscore data. This can be found using the ncaa_schedule_info
                     function.
    game_pbp_url     The url for the game’s play-by-play data. This can be found using the ncaa_schedule_info
                     function.
    raw_html_to_disk
                     Write raw html to disk (saves as game_pbp_id.html in raw_html_path direc-
                     tory)
    raw_html_path    Directory path to write raw html
    read_from_file Read from raw html on disk
    file             File with full path to read raw html
    ...              Additional arguments passed to an underlying function like httr.
ncaa_roster                                                                                         207
Value
    A data frame with play-by-play data for an individual game.
                                     col_name           types
                                      game_date         character
                                      location          character
                                      attendance        logical
                                      inning            character
                                      inning_top_bot    character
                                      score             character
                                      batting           character
                                      fielding          character
                                      description       character
                                      game_pbp_url      character
                                      game_pbp_id       integer
Examples
      try(ncaa_pbp(game_info_url = "https://stats.ncaa.org/contests/2167178/box_score"))
  ncaa_roster                 Get NCAA Baseball Rosters
Description
    Get NCAA Baseball Rosters
Usage
    ncaa_roster(team_id = NULL, year, ...)
Arguments
    team_id           NCAA id for a school
    year              The year of interest
    ...               Additional arguments passed to an underlying function like httr.
Value
    A data frame containing roster information, including IDs and urls for each player (if available)
                                      col_name         types
                                       player_name     character
                                       class           character
208                                                                                 ncaa_schedule_info
                                        player_id         character
                                        season            numeric
                                        number            character
                                        position          character
                                        player_url        character
                                        team_name         character
                                        conference        character
                                        team_id           numeric
                                        division          numeric
                                        conference_id     numeric
Examples
       try(ncaa_roster(team_id = 104, year = 2021))
  ncaa_schedule_info             Get Schedule and Results for NCAA Baseball Teams
Description
    Get Schedule and Results for NCAA Baseball Teams
Usage
    ncaa_schedule_info(team_id = NULL, year = NULL, pbp_links = FALSE, ...)
Arguments
    team_id              The team’s unique NCAA id.
    year                 The season (i.e. use 2016 for the 2015-2016 season, etc.)
    pbp_links            Logical parameter to run process for scraping play_by_play urls for each game
    ...                  Additional arguments passed to an underlying function like httr.
Details
      try(ncaa_schedule_info(team_id = 736, year = 2019))
Value
    A data frame with the following fields: date, opponent, result, score, innings (if more than regula-
    tion), and the url for the game itself.
                                 col_name                       types
                                  year                          integer
ncaa_school_id_lu                                                                                209
                                 season_id                      integer
                                 date                           character
                                 home_team                      character
                                 home_team_id                   integer
                                 home_team_conference           character
                                 home_team_conference_id        integer
                                 home_team_slug                 character
                                 home_team_division             integer
                                 away_team                      character
                                 away_team_id                   integer
                                 away_team_conference           character
                                 away_team_conference_id        integer
                                 away_team_slug                 character
                                 away_team_division             integer
                                 neutral_site                   character
                                 result                         character
                                 score                          character
                                 innings                        character
                                 slug                           character
                                 game_info_url                  character
                                 contest_id                     integer
  ncaa_school_id_lu             Lookup NCAA baseball school IDs (Division I, II, and III)
Description
    This function allows the user to look up the team_id needed for the ncaa_team_player_stats()
    function.
Usage
    ncaa_school_id_lu(team_name = NULL)
Arguments
    team_name           A string that will be searched for in the names of the teams.
Value
    Returns a tibble with school identification data: team_id, team_name, team_url, conference, con-
    ference_id, division, year, and season_id
                                        col_name         types
                                         team_id         numeric
                                         team_name       character
210                                                                                          ncaa_scrape
                                       team_url         character
                                       conference_id    numeric
                                       conference       character
                                       division         numeric
                                       year             numeric
                                       season_id        numeric
Examples
       try(ncaa_school_id_lu("Van"))
  ncaa_scrape                 (legacy) Scrape NCAA baseball Team Player Stats (Division I, II,
                              and III)
Description
    (legacy) Scrape NCAA baseball Team Player Stats (Division I, II, and III)
Usage
    ncaa_scrape(
       team_id,
       year = most_recent_ncaa_baseball_season(),
       type = "batting",
       ...
    )
Arguments
    team_id            The numerical ID that the NCAA website uses to identify a team
    year               The season for which data should be returned, in the form of "YYYY". Years
                       currently available: 2013-2017.
    type               A string indicating whether to return "batting" or "pitching" statistics
    ...                Additional arguments passed to an underlying function like httr.
Value
    A data frame with the following variables
                                      col_name          types
                                       year             integer
                                       team_name        character
                                       team_id          numeric
ncaa_teams                                                                         211
                                       conference_id integer
                                       conference    character
                                       division      numeric
                                       player_id     integer
                                       player_url    character
                                       player_name   character
                                       Yr            character
                                       Pos           character
                                       Jersey        character
                                       GP            numeric
                                       GS            numeric
                                       BA            numeric
                                       OBPct         numeric
                                       SlgPct        numeric
                                       R             numeric
                                       AB            numeric
                                       H             numeric
                                       2B            numeric
                                       3B            numeric
                                       TB            numeric
                                       HR            numeric
                                       RBI           numeric
                                       BB            numeric
                                       HBP           numeric
                                       SF            numeric
                                       SH            numeric
                                       K             numeric
                                       DP            numeric
                                       CS            numeric
                                       Picked        numeric
                                       SB            numeric
                                       RBI2out       numeric
  ncaa_teams                  Scrape NCAA baseball Teams (Division I, II, and III)
Description
    This function allows the user to obtain NCAA teams by year and division
Usage
    ncaa_teams(year = most_recent_ncaa_baseball_season(), division = 1, ...)
212                                                                              ncaa_team_player_stats
Arguments
    year                The season for which data should be returned, in the form of "YYYY". Years
                        currently available: 2002 onward.
    division            Division - 1, 2, 3
    ...                 Additional arguments passed to an underlying function like httr.
Details
    ncaa_teams(2023, 1)
Value
    A data frame with the following variables
                                        col_name         types
                                         team_id         character
                                         team_name       character
                                         team_url        character
                                         conference_id   character
                                         conference      character
                                         division        numeric
                                         year            numeric
                                         season_id       character
  ncaa_team_player_stats
                               Scrape NCAA baseball Team Player Stats (Division I, II, and III)
Description
    This function allows the user to obtain batting or pitching statistics for any school affiliated with
    the NCAA at the division I, II, or III levels. The function acquires data from the NCAA’s website
    (stats.ncaa.org) and returns a tibble.
Usage
    ncaa_team_player_stats(
       team_id,
       year = most_recent_ncaa_baseball_season(),
       type = "batting",
       ...
    )
ncaa_team_player_stats                                                                          213
Arguments
    team_id            The numerical ID that the NCAA website uses to identify a team
    year               The season for which data should be returned, in the form of "YYYY". Years
                       currently available: 2013-2017.
    type               A string indicating whether to return "batting" or "pitching" statistics
    ...                Additional arguments passed to an underlying function like httr.
Value
    A data frame with the following variables
                                      col_name          types
                                       year             integer
                                       team_name        character
                                       team_id          numeric
                                       conference_id    integer
                                       conference       character
                                       division         numeric
                                       player_id        integer
                                       player_url       character
                                       player_name      character
                                       Yr               character
                                       Pos              character
                                       Jersey           character
                                       GP               numeric
                                       GS               numeric
                                       BA               numeric
                                       OBPct            numeric
                                       SlgPct           numeric
                                       R                numeric
                                       AB               numeric
                                       H                numeric
                                       2B               numeric
                                       3B               numeric
                                       TB               numeric
                                       HR               numeric
                                       RBI              numeric
                                       BB               numeric
                                       HBP              numeric
                                       SF               numeric
                                       SH               numeric
                                       K                numeric
                                       DP               numeric
                                       CS               numeric
                                       Picked           numeric
                                       SB               numeric
                                       RBI2out          numeric
214                                                                                        playerid_lookup
Examples
       try(ncaa_team_player_stats(team_id = 234, year = 2023, type = "batting"))
  pitcher_game_logs_fg         (legacy) Scrape Pitcher Game Logs from FanGraphs
Description
    (legacy) Scrape Pitcher Game Logs from FanGraphs
Usage
    pitcher_game_logs_fg(playerid, year = 2017)
Arguments
    playerid           This is the playerid used by FanGraphs for a given player
    year               The season for which game logs should be returned (use the YYYY format)
Value
    A data frame of pitcher game logs.
  playerid_lookup              Look up Baseball Player IDs by Player Name
Description
    This function allows you to query the Chadwick Bureau’s public register of baseball players and
    the various IDs associated with them in different systems of record.
Usage
    playerid_lookup(last_name = NULL, first_name = NULL)
Arguments
    last_name          A text string used to return results for players with that string in their last name.
    first_name         A text string used to return results for players with that string in their first name.
Value
    A data frame of baseball players and the various IDs associated with them in different systems of
    record.
playername_lookup                                                                                   215
                                      col_name             types
                                       first_name          character
                                       last_name           character
                                       given_name          character
                                       name_suffix         character
                                       nick_name           character
                                       birth_year          integer
                                       mlb_played_first    integer
                                       mlbam_id            integer
                                       retrosheet_id       character
                                       bbref_id            character
                                       fangraphs_id        integer
Examples
       try(playerid_lookup("Garcia", "Karim"))
   playername_lookup           Look up Baseball Player Name by ID
Description
     This function allows you to query the Chadwick Bureau’s public register of baseball players and
     the various IDs associated with them in different systems of record.
Usage
     playername_lookup(id)
Arguments
     id                 An integer or character string representing a player ID in a baseball database,
                        cross-referenced through the Chadwick Bureau’s public register of baseball play-
                        ers.
Value
     A data frame of baseball players and the various IDs associated with them in different systems of
     record.
                                      col_name             types
                                       name_first          character
                                       name_last           character
                                       name_given          character
                                       name_suffix         character
216                                                                         process_statcast_payload
                                       name_nick          character
                                       birth_year         integer
                                       mlb_played_first   integer
                                       key_mlbam          integer
                                       key_retro          character
                                       key_bbref          character
                                       key_fangraphs      integer
Examples
      try(playername_lookup(4885))
      try(playername_lookup("kaaihki01"))
  process_statcast_payload
                               Process Baseball Savant CSV payload
Description
    This is a helper function for all statcast_search() functions. The function processes the initial
    csv payload acquired from Baseball Savant to ensure consistency in formatting across downloads
Usage
    process_statcast_payload(payload)
Arguments
    payload             payload from a Baseball Savant request
Value
    A tibble with the processed Statcast data coerced to the correct types.
retrosheet_data                                                                                        217
   retrosheet_data               Get, Parse, and Format Retrosheet Event and Roster Files
Description
     This function requires the use of the Chadwick CLI. Follow the directions at the repository for
     installation of the CLI release for your platform. Specifically from the Chadwick CLI tools, this
     function requires the cwevent application to be available from the command line. For unix platform
     users: the retrosheet_data() function uses the system() interface under the hood. For Windows
     and other platform users: the retrosheet_data() function interacts with the cwevent application
     using the shell() interface under the hood.
Usage
     retrosheet_data(
        path_to_directory = NULL,
        years_to_acquire = most_recent_mlb_season() - 1,
        sequence_years = FALSE
     )
Arguments
     path_to_directory
                         (default: NULL) A file path that if set, either:
                           1. creates a new directory, or
                           2. uses the path to an existing directory
     years_to_acquire
                         (format: YYYY) The seasons to collect. Single, multiple, and sequential years
                         can be passed. If passing multiple years, enclose in a vector (i.e. c(2017,2018)).
                         Defaults to most_recent_mlb_season().
     sequence_years (logical, default: FALSE): If the seasons passed in the years_to_acquire param-
                         eter should be sequenced so that the function returns all years including and
                         between the vector passed, set the argument to TRUE. Defaults to FALSE.
Details
     retrosheet_data(path_to_directory = NULL,
                          years_to_acquire = most_recent_mlb_season()-1,
                          sequence_years = FALSE)
Value
     If path_to_directory is not set (default), the process will return a named list of tibbles: ’events’
     and ’rosters’ for each season provided to years_to_acquire If path_to_directory is set, will
     also write two csv files to the unzipped directory: 1) a combined csv of the event data for a given
     year and 2) a combined csv of each team’s roster for each year provided to years_to_acquire
218                                                                             run_expectancy_code
  run_expectancy_code           Generate run expectancy and related measures from Baseball Sa-
                                vant data
Description
    These functions allow a user to generate run expectancy and related measures and variables from
    Baseball Savant data. Measures and variables will be added to the data frame.
Usage
    run_expectancy_code(df, level = "plate appearance")
Arguments
    df                  A data frame generated from Baseball Savant.
    level               Whether you want run expectancy calculated at the plate appearance or pitch
                        level. Defaults to plate appearance.
Value
    Returns a tibble with the following columns:
                            col_name                             types
                             pitch_type                          character
                             game_date                           Date
                             release_speed                       numeric
                             release_pos_x                       numeric
                             release_pos_z                       numeric
                             player_name                         character
                             batter                              numeric
                             pitcher                             numeric
                             events                              character
                             description                         character
                             spin_dir                            logical
                             spin_rate_deprecated                logical
                             break_angle_deprecated              logical
                             break_length_deprecated             logical
                             zone                                numeric
                             des                                 character
                             game_type                           character
                             stand                               character
                             p_throws                            character
                             home_team                           character
                             away_team                           character
                             type                                character
                             hit_location                        integer
run_expectancy_code                                           219
                    bb_type                         character
                    balls                           integer
                    strikes                         integer
                    game_year                       integer
                    pfx_x                           numeric
                    pfx_z                           numeric
                    plate_x                         numeric
                    plate_z                         numeric
                    on_3b                           numeric
                    on_2b                           numeric
                    on_1b                           numeric
                    outs_when_up                    integer
                    inning                          numeric
                    inning_topbot                   character
                    hc_x                            numeric
                    hc_y                            numeric
                    tfs_deprecated                  logical
                    tfs_zulu_deprecated             logical
                    fielder_2                       numeric
                    umpire                          logical
                    sv_id                           character
                    vx0                             numeric
                    vy0                             numeric
                    vz0                             numeric
                    ax                              numeric
                    ay                              numeric
                    az                              numeric
                    sz_top                          numeric
                    sz_bot                          numeric
                    hit_distance_sc                 numeric
                    launch_speed                    numeric
                    launch_angle                    numeric
                    effective_speed                 numeric
                    release_spin_rate               numeric
                    release_extension               numeric
                    game_pk                         numeric
                    pitcher_1                       numeric
                    fielder_2_1                     numeric
                    fielder_3                       numeric
                    fielder_4                       numeric
                    fielder_5                       numeric
                    fielder_6                       numeric
                    fielder_7                       numeric
                    fielder_8                       numeric
                    fielder_9                       numeric
                    release_pos_y                   numeric
                    estimated_ba_using_speedangle   numeric
                    estimated_woba_using_speedangle numeric
220                                                                    run_expectancy_code
                       woba_value                         numeric
                       woba_denom                         integer
                       babip_value                        integer
                       iso_value                          integer
                       launch_speed_angle                 integer
                       at_bat_number                      numeric
                       pitch_number                       numeric
                       pitch_name                         character
                       home_score                         numeric
                       away_score                         numeric
                       bat_score                          numeric
                       fld_score                          numeric
                       post_away_score                    numeric
                       post_home_score                    numeric
                       post_bat_score                     numeric
                       post_fld_score                     numeric
                       if_fielding_alignment              character
                       of_fielding_alignment              character
                       spin_axis                          numeric
                       delta_home_win_exp                 numeric
                       delta_run_exp                      numeric
                       final_pitch_game                   numeric
                       final_pitch_at_bat                 numeric
                       runs_scored_on_pitch               numeric
                       bat_score_after                    numeric
                       final_pitch_inning                 numeric
                       bat_score_start_inning             numeric
                       bat_score_end_inning               numeric
                       cum_runs_in_inning                 numeric
                       runs_to_end_inning                 numeric
                       count_base_out_state               character
                       avg_re                             numeric
                       next_count_base_out_state          character
                       next_avg_re                        numeric
                       change_re                          numeric
                       re24                               numeric
Examples
    df <- statcast_search(start_date = "2016-04-06", end_date = "2016-04-15",
                           playerid = 621043, player_type = 'batter')
    try(run_expectancy_code(df, level = "plate appearances"))
school_id_lu                                                                                     221
  school_id_lu                  (legacy) Lookup NCAA baseball school IDs (Division I, II, and III)
Description
    (legacy) Lookup NCAA baseball school IDs (Division I, II, and III)
Usage
    school_id_lu(team_name = NULL)
Arguments
    team_name           A string that will be searched for in the names of the teams.
Value
    Returns a tibble with school identification data: team_id, team_name, team_url, conference, con-
    ference_id, division, year, and season_id
  scrape_savant_leaderboards
                                (legacy) Query Baseball Savant Leaderboards
Description
    (legacy) Query Baseball Savant Leaderboards
Usage
    scrape_savant_leaderboards(
       leaderboard = "exit_velocity_barrels",
       year = 2020,
       abs = 50,
       min_pa = "q",
       min_pitches = 100,
       min_throws = 100,
       min_field = "q",
       min_run = 0,
       player_type = "batter",
       fielding_type = "player",
       oaa_position = "",
       oaa_roles = "",
       team = "",
       arsenal_type = "n_",
222                                                                           scrape_savant_leaderboards
      run_type = "raw",
      min2b = 5,
      min3b = 0,
      position = "",
      bats = "",
      hand = ""
    )
Arguments
    leaderboard         The type of leaderboard to retrieve, input as a string. Current options include
                        exit_velocity_barrels, expected_statistics, pitch_arsenal, outs_above_average, di-
                        rectional_oaa, catch_probability, pop_time, sprint_speed, and running_splits_90_ft,
                        arm_strength.
    year                The season for which you want data.
    abs                 The minimum number of batted balls. Applies only to exit_velocity_barrels
                        leaderboards.
    min_pa              Minimum number of plate appearances. Can be a number or ’q’ for qualified
                        batters.
    min_pitches         Minimum number of pitches thrown.
    min_throws          Minimum number of throwing opportunities.
    min_field           Minimum number of fieding opportunities.
    min_run             Minimum number of running opportunities.
    player_type         One of either ’batter’ or pitcher. For the expected_statistics leaderboard, ’batter-
                        team’ and ’pitcher-team’ are also available.
    fielding_type       One of either ’player’ or ’team’.
    oaa_position        Can be either the number position of a player or ’if’ or ’of’ for position cate-
                        gories.
    oaa_roles           Can be either the number position of a player or ’if’ or ’of’ for position cate-
                        gories.
    team                An abbreviation for a team. Can be left blank.
    arsenal_type        One of either ’n_’, ’avg_spin’, or ’avg_speed’.
    run_type            One of either ’percent’ or ’raw’.
    min2b               The minimum number of throwing attempts to second base.
    min3b               The minimum number of throwing attempts to third base.
    position            The numeric position of the player. For DH use 10. Can be left blank.
    bats                The handedness of the batter. One of ’R’ or ’L’. Can be left blank.
    hand                The handedness of the pitcher. One of ’R’ or ’L’. Can be left blank.
Value
    Returns a tibble of Statcast leaderboard data.
scrape_statcast_savant                                                                       223
   scrape_statcast_savant
                              (legacy) Query Statcast by Date Range and Players
Description
     (legacy) Query Statcast by Date Range and Players
Usage
     scrape_statcast_savant(
        start_date = Sys.Date() - 1,
        end_date = Sys.Date(),
        playerid = NULL,
        player_type = "batter",
        ...
     )
     scrape_statcast_savant.Date(
        start_date = Sys.Date() - 1,
        end_date = Sys.Date(),
        playerid = NULL,
        player_type = "batter",
        ...
     )
     scrape_statcast_savant.default(
        start_date = Sys.Date() - 1,
        end_date = Sys.Date(),
        playerid = NULL,
        player_type = "batter",
        ...
     )
     scrape_statcast_savant_batter(start_date, end_date, batterid = NULL, ...)
     scrape_statcast_savant_batter_all(start_date, end_date, batterid = NULL, ...)
     scrape_statcast_savant_pitcher(start_date, end_date, pitcherid = NULL, ...)
     scrape_statcast_savant_pitcher_all(start_date, end_date, pitcherid = NULL, ...)
Arguments
     start_date        Date of first game for which you want data. Format must be in YYYY-MM-DD
                       format.
224                                                                            sptrc_league_payrolls
    end_date            Date of last game for which you want data. Format must be in YYYY-MM-DD
                        format.
    playerid            The MLBAM ID for the player whose data you want to query.
    player_type         The player type. Can be batter or pitcher. Default is batter
    ...                 currently ignored
    batterid            The MLBAM ID for the batter whose data you want to query.
    pitcherid           The MLBAM ID for the pitcher whose data you want to query.
Value
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
    Returns a tibble with Statcast data.
  sptrc_league_payrolls Scrape League Payroll Breakdowns from Spotrac
Description
    This function allows you to scrape each team’s payroll from Spotrac.
Usage
    sptrc_league_payrolls(year = most_recent_mlb_season())
Arguments
    year                Year to load
Value
    A data frame of contract data.
                                    col_name              types
                                     year                 character
                                     team                 character
                                     team_abbr            character
                                     rank                 numeric
                                     win_percent          numeric
                                     roster               numeric
sptrc_team_active_payroll                                                        225
                                    active_man_payroll      numeric
                                    injured_reserve         numeric
                                    retained                numeric
                                    buried                  numeric
                                    suspended               numeric
                                    yearly_total_payroll    numeric
Examples
       try(sptrc_league_payrolls(year = most_recent_mlb_season()))
   sptrc_team_active_payroll
                               Scrape Team Active Payroll Breakdown from Spotrac
Description
     This function allows you to scrape a team’s active payroll from Spotrac.
Usage
     sptrc_team_active_payroll(team_abbr, year = most_recent_mlb_season())
Arguments
     team_abbr          Team abbreviation
     year               Year to load
Value
     A data frame of contract data.
                                      col_name           types
                                       year              numeric
                                       team              character
                                       player_name       character
                                       roster_status     character
                                       age               numeric
                                       pos               numeric
                                       status            numeric
                                       waiver_options    numeric
                                       base_salary       numeric
                                       signing_bonus     numeric
                                       payroll_salary    numeric
226                                                                            standings_on_date_bref
                                       adj_salary        numeric
                                       payroll_percent   numeric
                                       lux_tax_salary    numeric
                                       total_salary      numeric
Examples
     try(sptrc_team_active_payroll(team_abbr = "BAL", year = most_recent_mlb_season()))
  standings_on_date_bref
                               (legacy) Scrape MLB Standings on a Given Date
Description
    (legacy) Scrape MLB Standings on a Given Date
Usage
    standings_on_date_bref(date, division, from = FALSE)
Arguments
    date                a date object
    division            One or more of AL East, AL Central, AL West, AL Overall, NL East, NL Cen-
                        tral, NL West, and NL Overall
    from                a logical indicating whether you want standings up to and including the date
                        (FALSE, default) or rather standings for games played after the date
Value
    Returns a tibble of MLB standings
statcast                                                                           227
   statcast                  Statcast Functions Overview
Description
     statcast_search(): Query Statcast by Date Range and Players.
     statcast_search_batters(): Query Statcast Batters by Date Range and Player.
     statcast_search_pitchers(): Query Statcast Pitchers by Date Range and Player.
     statcast_leaderboards(): Query Baseball Savant Leaderboards.
Details
       Query Statcast Batters by Date Range:
       statcast_search(start_date = "2016-04-06",
                         end_date = "2016-04-15",
                         player_type = 'batter')
         ## The above is equivalent to:
       statcast_search_batters(start_date = "2016-04-06",
                                  end_date = "2016-04-15",
                                  batterid = NULL)
       Query Statcast Pitchers by Date Range:
       statcast_search(start_date = "2016-04-06",
                         end_date = "2016-04-15",
                         player_type = 'pitcher')
         ## The above is equivalent to:
       statcast_search_pitchers(start_date = "2016-04-06",
                                   end_date = "2016-04-15",
                                   pitcherid = NULL)
       Query Statcast Batters by Date Range and Player ID:
          correa <- statcast_search(start_date = "2016-04-06",
                                       end_date = "2016-04-15",
                                       playerid = 621043,
                                       player_type = 'batter')
         ## The above is equivalent to:
          correa <- statcast_search_batters(start_date = "2016-04-06",
                                                end_date = "2016-04-15",
                                                batterid = 621043)
       Query Statcast Pitchers by Date Range and Player ID:
228                                                                               statcast_leaderboards
        noah <- statcast_search(start_date = "2016-04-06",
                                       end_date = "2016-04-15",
                                       playerid = 592789,
                                       player_type = 'pitcher')
       ## The above is equivalent to:
        noah <- statcast_search_pitchers(start_date = "2016-04-06",
                                                end_date = "2016-04-15",
                                                pitcherid = 592789)
      Query Baseball Savant Leaderboards:
        statcast_leaderboards(leaderboard = "exit_velocity_barrels", year = 2021)
  statcast_impute              Statcast Label Imputation
Description
    Statcast Label Imputation
Usage
    statcast_impute
Format
    An object of class data.frame with 44 rows and 4 columns.
  statcast_leaderboards Query Baseball Savant Leaderboards
Description
    This function allows you to read leaderboard data from BaseballSavant directly into R as data frame.
Usage
    statcast_leaderboards(
      leaderboard = "exit_velocity_barrels",
      year = 2020,
      abs = 50,
      min_pa = "q",
      min_pitches = 100,
      min_throws = 100,
      min_field = "q",
statcast_leaderboards                                                                                 229
        min_run = 0,
        player_type = "batter",
        fielding_type = "player",
        oaa_position = "",
        oaa_roles = "",
        team = "",
        arsenal_type = "n_",
        run_type = "raw",
        min2b = 5,
        min3b = 0,
        position = "",
        bats = "",
        hand = ""
     )
Arguments
     leaderboard      The type of leaderboard to retrieve, input as a string. Current options include
                      exit_velocity_barrels, expected_statistics, pitch_arsenal, outs_above_average, di-
                      rectional_oaa, catch_probability, pop_time, sprint_speed, and running_splits_90_ft,
                      arm_strength.
     year             The season for which you want data.
     abs              The minimum number of batted balls. Applies only to exit_velocity_barrels
                      leaderboards.
     min_pa           Minimum number of plate appearances. Can be a number or ’q’ for qualified
                      batters.
     min_pitches      Minimum number of pitches thrown.
     min_throws       Minimum number of throwing opportunities.
     min_field        Minimum number of fieding opportunities.
     min_run          Minimum number of running opportunities.
     player_type      One of either ’batter’ or pitcher. For the expected_statistics leaderboard, ’batter-
                      team’ and ’pitcher-team’ are also available.
     fielding_type    One of either ’player’ or ’team’.
     oaa_position     Can be either the number position of a player or ’if’ or ’of’ for position cate-
                      gories.
     oaa_roles        Can be either the number position of a player or ’if’ or ’of’ for position cate-
                      gories.
     team             An abbreviation for a team. Can be left blank.
     arsenal_type     One of either ’n_’, ’avg_spin’, or ’avg_speed’.
     run_type         One of either ’percent’ or ’raw’.
     min2b            The minimum number of throwing attempts to second base.
     min3b            The minimum number of throwing attempts to third base.
     position         The numeric position of the player. For DH use 10. Can be left blank.
     bats             The handedness of the batter. One of ’R’ or ’L’. Can be left blank.
     hand             The handedness of the pitcher. One of ’R’ or ’L’. Can be left blank.
230                                                                                       statcast_search
Details
    oaa_roles argument: 30 = 1B - Straight Up 31 = 1B - Towards 1B/2B Hole 32 = 1B - Close to Line
    40 = 2B - Straight Up 41 = 2B - Shaded Towards 2B Bag 42 = 2B - Towards 1B/2B Hole 43 = 2B
    - Behind First Basemen 46 = 2B - Up the Middle 60 = SS - Straight Up 61 = SS - Towards 3B/SS
    Hole 62 = SS - Shaded Towards 2B Bag 64 = SS - Up the Middle 50 = 3B - Straight Up 51 = 3B -
    Close to Line 52 = 3B - Towards 3B/SS Hole 77 = LF - Close to Line 71 = LF - Leaning Left 70 =
    LF - Straight Up 72 = LF - Leaning Right 78 = LF - LF Gap 87 = CF - LF Gap 81 = CF - Leaning
    Left 82 = CF - Leaning Right 89 = CF - RF Gap 98 = RF - RF Gap 91 = RF - Leaning Left 90 = RF
    - Straight Up 92 = RF - Leaning Right 99 = RF - Close to Line
Value
    Returns a tibble of Statcast leaderboard data with the following columns (for leaderboard: ’exit_velocity_barrels’):
                                    col_name                   types
                                     year                      numeric
                                     last_name                 character
                                     first_name                character
                                     player_id                 integer
                                     attempts                  integer
                                     avg_hit_angle             numeric
                                     anglesweetspotpercent     numeric
                                     max_hit_speed             numeric
                                     avg_hit_speed             numeric
                                     fbld                      numeric
                                     gb                        numeric
                                     max_distance              integer
                                     avg_distance              integer
                                     avg_hr_distance           integer
                                     ev95plus                  integer
                                     ev95per-swing             numeric
                                     ev95percent               numeric
                                     barrels                   integer
                                     brl_percent               numeric
                                     brl_pa                    numeric
Examples
       try(statcast_leaderboards(leaderboard = "expected_statistics", year = 2018))
       try(statcast_leaderboards(leaderboard = "arm_strength", year = 2020))
  statcast_search               Query Statcast by Date Range and Players
statcast_search                                                                                231
Description
     This function allows you to query Statcast data as provided on https://baseballsavant.mlb.com
Usage
     statcast_search(
        start_date = Sys.Date() - 1,
        end_date = Sys.Date(),
        playerid = NULL,
        player_type = "batter",
        ...
     )
     statcast_search.default(
        start_date = Sys.Date() - 1,
        end_date = Sys.Date(),
        playerid = NULL,
        player_type = "batter",
        ...
     )
     statcast_search_batters(start_date, end_date, batterid = NULL, ...)
     statcast_search_pitchers(start_date, end_date, pitcherid = NULL, ...)
Arguments
     start_date          Date of first game for which you want data. Format must be in YYYY-MM-DD
                         format.
     end_date            Date of last game for which you want data. Format must be in YYYY-MM-DD
                         format.
     playerid            The MLBAM ID for the player whose data you want to query.
     player_type         The player type. Can be batter or pitcher. Default is batter
     ...                 currently ignored
     batterid            The MLBAM ID for the batter whose data you want to query.
     pitcherid           The MLBAM ID for the pitcher whose data you want to query.
Value
     Returns a tibble with Statcast data with the following columns:
                             col_name                                types
                              pitch_type                             character
                              game_date                              Date
                              release_speed                          numeric
                              release_pos_x                          numeric
                              release_pos_z                          numeric
232                                   statcast_search
    player_name             character
    batter                  numeric
    pitcher                 numeric
    events                  character
    description             character
    spin_dir                logical
    spin_rate_deprecated    logical
    break_angle_deprecated  logical
    break_length_deprecated logical
    zone                    numeric
    des                     character
    game_type               character
    stand                   character
    p_throws                character
    home_team               character
    away_team               character
    type                    character
    hit_location            integer
    bb_type                 character
    balls                   integer
    strikes                 integer
    game_year               integer
    pfx_x                   numeric
    pfx_z                   numeric
    plate_x                 numeric
    plate_z                 numeric
    on_3b                   numeric
    on_2b                   numeric
    on_1b                   numeric
    outs_when_up            integer
    inning                  numeric
    inning_topbot           character
    hc_x                    numeric
    hc_y                    numeric
    tfs_deprecated          logical
    tfs_zulu_deprecated     logical
    fielder_2               numeric
    umpire                  logical
    sv_id                   character
    vx0                     numeric
    vy0                     numeric
    vz0                     numeric
    ax                      numeric
    ay                      numeric
    az                      numeric
    sz_top                  numeric
    sz_bot                  numeric
    hit_distance_sc         numeric
statcast_search                                                              233
                             launch_speed                          numeric
                             launch_angle                          numeric
                             effective_speed                       numeric
                             release_spin_rate                     numeric
                             release_extension                     numeric
                             game_pk                               numeric
                             pitcher_1                             numeric
                             fielder_2_1                           numeric
                             fielder_3                             numeric
                             fielder_4                             numeric
                             fielder_5                             numeric
                             fielder_6                             numeric
                             fielder_7                             numeric
                             fielder_8                             numeric
                             fielder_9                             numeric
                             release_pos_y                         numeric
                             estimated_ba_using_speedangle         numeric
                             estimated_woba_using_speedangle       numeric
                             woba_value                            numeric
                             woba_denom                            integer
                             babip_value                           integer
                             iso_value                             integer
                             launch_speed_angle                    integer
                             at_bat_number                         numeric
                             pitch_number                          numeric
                             pitch_name                            character
                             home_score                            numeric
                             away_score                            numeric
                             bat_score                             numeric
                             fld_score                             numeric
                             post_away_score                       numeric
                             post_home_score                       numeric
                             post_bat_score                        numeric
                             post_fld_score                        numeric
                             if_fielding_alignment                 character
                             of_fielding_alignment                 character
                             spin_axis                             numeric
                             delta_home_win_exp                    numeric
                             delta_run_exp                         numeric
     Returns a tibble with Statcast data.
     Returns a tibble with Statcast data with the following columns:
                            col_name                               types
                             pitch_type                            character
                             game_date                             Date
                             release_speed                         numeric
234                                   statcast_search
    release_pos_x           numeric
    release_pos_z           numeric
    player_name             character
    batter                  numeric
    pitcher                 numeric
    events                  character
    description             character
    spin_dir                logical
    spin_rate_deprecated    logical
    break_angle_deprecated  logical
    break_length_deprecated logical
    zone                    numeric
    des                     character
    game_type               character
    stand                   character
    p_throws                character
    home_team               character
    away_team               character
    type                    character
    hit_location            integer
    bb_type                 character
    balls                   integer
    strikes                 integer
    game_year               integer
    pfx_x                   numeric
    pfx_z                   numeric
    plate_x                 numeric
    plate_z                 numeric
    on_3b                   numeric
    on_2b                   numeric
    on_1b                   numeric
    outs_when_up            integer
    inning                  numeric
    inning_topbot           character
    hc_x                    numeric
    hc_y                    numeric
    tfs_deprecated          logical
    tfs_zulu_deprecated     logical
    fielder_2               numeric
    umpire                  logical
    sv_id                   character
    vx0                     numeric
    vy0                     numeric
    vz0                     numeric
    ax                      numeric
    ay                      numeric
    az                      numeric
    sz_top                  numeric
statcast_search                                                              235
                             sz_bot                                numeric
                             hit_distance_sc                       numeric
                             launch_speed                          numeric
                             launch_angle                          numeric
                             effective_speed                       numeric
                             release_spin_rate                     numeric
                             release_extension                     numeric
                             game_pk                               numeric
                             pitcher_1                             numeric
                             fielder_2_1                           numeric
                             fielder_3                             numeric
                             fielder_4                             numeric
                             fielder_5                             numeric
                             fielder_6                             numeric
                             fielder_7                             numeric
                             fielder_8                             numeric
                             fielder_9                             numeric
                             release_pos_y                         numeric
                             estimated_ba_using_speedangle         numeric
                             estimated_woba_using_speedangle       numeric
                             woba_value                            numeric
                             woba_denom                            integer
                             babip_value                           integer
                             iso_value                             integer
                             launch_speed_angle                    integer
                             at_bat_number                         numeric
                             pitch_number                          numeric
                             pitch_name                            character
                             home_score                            numeric
                             away_score                            numeric
                             bat_score                             numeric
                             fld_score                             numeric
                             post_away_score                       numeric
                             post_home_score                       numeric
                             post_bat_score                        numeric
                             post_fld_score                        numeric
                             if_fielding_alignment                 character
                             of_fielding_alignment                 character
                             spin_axis                             numeric
                             delta_home_win_exp                    numeric
                             delta_run_exp                         numeric
     Returns a tibble with Statcast data with the following columns:
                            col_name                               types
                             pitch_type                            character
                             game_date                             Date
236                                   statcast_search
    release_speed           numeric
    release_pos_x           numeric
    release_pos_z           numeric
    player_name             character
    batter                  numeric
    pitcher                 numeric
    events                  character
    description             character
    spin_dir                logical
    spin_rate_deprecated    logical
    break_angle_deprecated  logical
    break_length_deprecated logical
    zone                    numeric
    des                     character
    game_type               character
    stand                   character
    p_throws                character
    home_team               character
    away_team               character
    type                    character
    hit_location            integer
    bb_type                 character
    balls                   integer
    strikes                 integer
    game_year               integer
    pfx_x                   numeric
    pfx_z                   numeric
    plate_x                 numeric
    plate_z                 numeric
    on_3b                   numeric
    on_2b                   numeric
    on_1b                   numeric
    outs_when_up            integer
    inning                  numeric
    inning_topbot           character
    hc_x                    numeric
    hc_y                    numeric
    tfs_deprecated          logical
    tfs_zulu_deprecated     logical
    fielder_2               numeric
    umpire                  logical
    sv_id                   character
    vx0                     numeric
    vy0                     numeric
    vz0                     numeric
    ax                      numeric
    ay                      numeric
    az                      numeric
statcast_search                                                     237
                          sz_top                          numeric
                          sz_bot                          numeric
                          hit_distance_sc                 numeric
                          launch_speed                    numeric
                          launch_angle                    numeric
                          effective_speed                 numeric
                          release_spin_rate               numeric
                          release_extension               numeric
                          game_pk                         numeric
                          pitcher_1                       numeric
                          fielder_2_1                     numeric
                          fielder_3                       numeric
                          fielder_4                       numeric
                          fielder_5                       numeric
                          fielder_6                       numeric
                          fielder_7                       numeric
                          fielder_8                       numeric
                          fielder_9                       numeric
                          release_pos_y                   numeric
                          estimated_ba_using_speedangle   numeric
                          estimated_woba_using_speedangle numeric
                          woba_value                      numeric
                          woba_denom                      integer
                          babip_value                     integer
                          iso_value                       integer
                          launch_speed_angle              integer
                          at_bat_number                   numeric
                          pitch_number                    numeric
                          pitch_name                      character
                          home_score                      numeric
                          away_score                      numeric
                          bat_score                       numeric
                          fld_score                       numeric
                          post_away_score                 numeric
                          post_home_score                 numeric
                          post_bat_score                  numeric
                          post_fld_score                  numeric
                          if_fielding_alignment           character
                          of_fielding_alignment           character
                          spin_axis                       numeric
                          delta_home_win_exp              numeric
                          delta_run_exp                   numeric
Examples
       ### Harper
       try(statcast_search(start_date = "2022-10-06",
238                                                                                 statline_from_statcast
                             end_date = "2022-10-16",
                             playerid = 547180,
                             player_type = 'batter'))
      ### Framber
      try(statcast_search(start_date = "2022-10-06",
                             end_date = "2022-10-16",
                             playerid = 664285,
                             player_type = 'pitcher'))
      ### Daily
      try(statcast_search(start_date = "2022-11-04",
                             end_date = "2022-11-06"))
      correa <- statcast_search_batters(start_date = "2016-04-06",
         end_date = "2016-04-15", batterid = 621043)
      daily <- statcast_search_batters(start_date = "2016-04-06",
         end_date = "2016-04-06", batterid = NULL)
      x <- statcast_search_pitchers(start_date = "2016-04-06",
         end_date = "2016-04-15", pitcherid = 592789)
      daily <- statcast_search_pitchers(start_date = "2016-04-06",
         end_date = "2016-04-06", pitcherid = NULL)
  statline_from_statcast
                               Create stat lines from Statcast data
Description
    This function allows you to create stat lines of statistics for players or groups of players from raw
    Statcast. When calculating wOBA, the most recent year in the data frame is used for weighting.
Usage
    statline_from_statcast(df, base = "pa")
Arguments
    df                 A data frame of statistics that includes, at a minimum, the following columns:
                       events, description, game_date, and type.
    base               Tells the function what to use as the population of pitches to use for the stat line.
                       Options include "swings", "contact", or "pa". Defaults to "pa".
Details
    statline_from_statcast(df, base = "contact")
stats_api_live_empty_df                                                                     239
Value
     A tibble with the additional columns calculated using the Statcast data.
   stats_api_live_empty_df
                                Column structure of MLB Stats Live Game API data frame
Description
     An empty tibble
Usage
     stats_api_live_empty_df
Format
     An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 131 columns.
   teams_lu_table               A Team Lookup Table
Description
     A Team Lookup Table
Usage
     teams_lu_table
Format
     An object of class data.frame with 797 rows and 31 columns.
240                                                                                   team_results_bref
  team_consistency             Calculate Team-level Consistency
Description
    This function allows you to calculate team-level consistency in run scoring and run prevention over
    the course of an entire season.
Usage
    team_consistency(year)
Arguments
    year                Season consistency should be run for.
Details
    try(team_consistency(year=2021))
Value
    Returns a tibble with the following columns
                                      col_name          types
                                       Team             character
                                       Con_R            numeric
                                       Con_RA           numeric
                                       Con_R_Ptile      numeric
                                       Con_RA_Ptile     numeric
  team_results_bref            (legacy) Scrape Team Results
Description
    (legacy) Scrape Team Results
Usage
    team_results_bref(Tm, year)
woba_plus                                                                                           241
Arguments
    Tm                   The abbreviation used by Baseball-Reference.com for the team whose results
                         you want to scrape.
    year                 Season for which you want to scrape the park factors.
Value
    Returns a tibble of MLB team results
  woba_plus                      Calculate wOBA and related metrics for any set of data
Description
    This function allows you to calculate wOBA for any given set of data, provided the right variables
    are in the data set. The function currently returns both wOBA per plate appearance on wOBA per
    instance of fair contact.
Usage
    woba_plus(df)
Arguments
    df                   A data frame of statistics that includes, at a minimum, the following columns:
                         uBB (unintentional walks), HBP (Hit By Pitch), X1B (singles), X2B (doubles),
                         X3B (triples), HR (home runs), AB (at-bats), SH (sacrifice hits), SO (strike
                         outs), and season.
Value
    Returns a tibble with the wOBA factors calculated and the following columns:
                                        col_name          types
                                         bbref_id         character
                                         season           integer
                                         Name             character
                                         Age              numeric
                                         Level            character
                                         Team             character
                                         G                numeric
                                         PA               numeric
                                         AB               numeric
                                         R                numeric
                                         H                numeric
                                         X1B              numeric
                                         X2B              numeric
242                                                     woba_plus
                                 X3B           numeric
                                 HR            numeric
                                 RBI           numeric
                                 BB            numeric
                                 IBB           numeric
                                 uBB           numeric
                                 SO            numeric
                                 HBP           numeric
                                 SH            numeric
                                 SF            numeric
                                 GDP           numeric
                                 SB            numeric
                                 CS            numeric
                                 BA            numeric
                                 OBP           numeric
                                 SLG           numeric
                                 OPS           numeric
                                 wOBA          numeric
                                 wOBA_CON      numeric
Examples
    df <- bref_daily_batter("2015-08-01", "2015-10-03")
    try(woba_plus(df))
Index
∗ datasets                               bref_standings_on_date, 10
     column_structure_draft_mlb, 14      bref_team_results, 11
     statcast_impute, 228
     stats_api_live_empty_df, 239        chadwick, 12
     teams_lu_table, 239                 chadwick_player_lu, 12
∗ legacy                                 code_barrel, 14
     batter_game_logs_fg, 6              column_structure_draft_mlb, 14
     daily_batter_bref, 15
                                         daily_batter_bref, 15
     daily_pitcher_bref, 15
                                         daily_pitcher_bref, 15
     fg_bat_leaders, 27
     fg_pitch_leaders, 45                edge_code, 16
     get_batting_orders, 62              edge_frequency, 17
     get_draft_mlb, 62
     get_game_info_mlb, 63               fangraphs, 17
     get_game_info_sup_petti, 63         fg_bat_leaders, 27
     get_game_pks_mlb, 64                fg_batter_game_logs, 18
     get_ncaa_baseball_pbp, 64           fg_batter_leaders, 20
     get_ncaa_game_logs, 65              fg_guts, 28
     get_ncaa_lineups, 66                fg_milb_batter_game_logs, 28
     get_ncaa_park_factor, 66            fg_milb_pitcher_game_logs, 30
     get_ncaa_schedule_info, 67          fg_park, 32
     get_pbp_mlb, 67                     fg_park_hand (fg_park), 32
     get_probables_mlb, 68               fg_pitch_leaders, 45
     get_retrosheet_data, 68             fg_pitcher_game_logs, 33
     get_umpire_ids_petti, 69            fg_pitcher_leaders, 37
     milb_batter_game_logs_fg, 80        fg_team_batter, 46
     milb_pitcher_game_logs_fg, 80       fg_team_pitcher, 53
     ncaa_baseball_roster, 202           fip_plus, 60
     ncaa_scrape, 210
     pitcher_game_logs_fg, 214           get_batting_orders, 62
     school_id_lu, 221                   get_chadwick_lu (chadwick_player_lu), 12
     scrape_savant_leaderboards, 221     get_draft_mlb, 62
     scrape_statcast_savant, 223         get_game_info_mlb, 63
     standings_on_date_bref, 226         get_game_info_sup_petti, 63
     team_results_bref, 240              get_game_pks_mlb, 64
                                         get_ncaa_baseball_pbp, 64
batter_game_logs_fg, 6                   get_ncaa_baseball_roster
bref, 6                                           (ncaa_baseball_roster), 202
bref_daily_batter, 7                     get_ncaa_game_logs, 65
bref_daily_pitcher, 8                    get_ncaa_lineups, 66
                                     243
244                                                                INDEX
get_ncaa_park_factor, 66          mlb_high_low_types, 121
get_ncaa_schedule_info, 67        mlb_hit_trajectories, 121
get_pbp_mlb, 67                   mlb_homerun_derby, 122
get_probables_mlb, 68             mlb_homerun_derby_bracket, 124
get_retrosheet_data, 68           mlb_homerun_derby_players, 125
get_umpire_ids_petti, 69          mlb_job_types, 131
ggspraychart, 70                  mlb_jobs, 128
                                  mlb_jobs_datacasters, 128
label_statcast_imputed_data, 71   mlb_jobs_official_scorers, 129
linear_weights_savant, 74         mlb_jobs_umpires, 130
load_game_info_sup, 74            mlb_languages, 131
load_ncaa_baseball_pbp, 75        mlb_league, 132
load_ncaa_baseball_schedule, 76   mlb_league_leader_types, 132
load_ncaa_baseball_season_ids, 77 mlb_logical_events, 133
load_ncaa_baseball_teams, 78      mlb_metrics, 134
load_umpire_ids, 78               mlb_pbp, 134
                                  mlb_pbp_diff, 138
metrics, 79
                                  mlb_people, 141
milb_batter_game_logs_fg, 80
                                  mlb_people_free_agents, 143
milb_pitcher_game_logs_fg, 80
                                  mlb_pitch_codes, 144
mlb, 81
                                  mlb_pitch_types, 144
mlb_all_star_ballots, 82
mlb_all_star_final_vote, 83       mlb_player_game_stats, 145
mlb_all_star_write_ins, 85        mlb_player_game_stats_current, 148
mlb_attendance, 86                mlb_player_status_codes, 150
mlb_award, 88                     mlb_positions, 151
mlb_awards, 89                    mlb_probables, 152
mlb_awards_recipient, 90          mlb_review_reasons, 152
mlb_baseball_stats, 91            mlb_roster_types, 154
mlb_batting_orders, 92            mlb_rosters, 153
mlb_conferences, 93               mlb_runner_detail_types, 155
mlb_divisions, 93                 mlb_schedule, 155
mlb_draft, 94                     mlb_schedule_event_types, 158
mlb_draft_latest, 96              mlb_schedule_games_tied, 159
mlb_draft_prospects, 99           mlb_schedule_postseason, 161
mlb_event_types, 102              mlb_schedule_postseason_series, 164
mlb_fielder_detail_types, 102     mlb_seasons, 166
mlb_game_changes, 103             mlb_seasons_all, 167
mlb_game_content, 105             mlb_situation_codes, 169
mlb_game_context_metrics, 106     mlb_sky, 169
mlb_game_info, 108                mlb_sports, 170
mlb_game_linescore, 109           mlb_sports_info, 171
mlb_game_pace, 111                mlb_sports_players, 172
mlb_game_pks, 113                 mlb_standings, 173
mlb_game_status_codes, 115        mlb_standings_types, 176
mlb_game_timecodes, 116           mlb_stat_groups, 182
mlb_game_types, 116               mlb_stat_types, 183
mlb_game_wp, 117                  mlb_stats, 176
mlb_high_low_stats, 118           mlb_stats_leaders, 179
INDEX                                                                 245
mlb_team_affiliates, 188               sptrc_league_payrolls, 224
mlb_team_alumni, 190                   sptrc_team_active_payroll, 225
mlb_team_coaches, 191                  standings_on_date_bref, 226
mlb_team_history, 192                  statcast, 227
mlb_team_info, 193                     statcast_impute, 228
mlb_team_leaders, 194                  statcast_leaderboards, 228
mlb_team_personnel, 196                statcast_search, 230
mlb_team_stats, 197                    statcast_search_batters
mlb_teams, 183                                 (statcast_search), 230
mlb_teams_stats, 185                   statcast_search_pitchers
mlb_teams_stats_leaders, 187                   (statcast_search), 230
mlb_venues, 198                        statline_from_statcast, 238
mlb_wind_direction_codes, 199          stats_api_live_empty_df, 239
most_recent_mlb_season, 200
most_recent_ncaa_baseball_season, 200  team_consistency, 240
                                       team_results_bref, 240
ncaa, 201                              teams_lu_table, 239
ncaa_baseball_pbp
         (get_ncaa_baseball_pbp), 64   woba_plus, 241
ncaa_baseball_roster, 202
ncaa_game_logs, 202
ncaa_lineups, 204
ncaa_park_factor, 205
ncaa_pbp, 206
ncaa_roster, 207
ncaa_schedule_info, 208
ncaa_school_id_lu, 209
ncaa_scrape, 210
ncaa_team_player_stats, 212
ncaa_teams, 211
pitcher_game_logs_fg, 214
playerid_lookup, 214
playername_lookup, 215
process_statcast_payload, 216
retrosheet_data, 217
run_expectancy_code, 218
school_id_lu, 221
scrape_savant_leaderboards, 221
scrape_statcast_savant, 223
scrape_statcast_savant_batter
         (scrape_statcast_savant), 223
scrape_statcast_savant_batter_all
         (scrape_statcast_savant), 223
scrape_statcast_savant_pitcher
         (scrape_statcast_savant), 223
scrape_statcast_savant_pitcher_all
         (scrape_statcast_savant), 223
