Skip to content

Releases: BillPetti/baseballr

baseballr 1.6.0

16 Jan 14:05
Compare
Choose a tag to compare

Primarily focused on parameter changes to the fg_*() functions to allow for more flexible data retrieval. See below for details.

The parameters are now as follows for the leaderboard functions:

  • age (integer) Age of players
  • pos (character) Position of players, defaults to "all". To exclude pitchers, use "np".
  • stats (character) Statistic to return. Defaults to "bat".
  • lg (character) League to return. Defaults to "all". Options are "al", "nl", or "all".
  • qual (character) 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".
  • startseason (character) Season for which you want to scrape the data.
  • endseason (character) Last season for which you want data.
  • startdate (character) Start date for which you want data.
  • enddate (character) End date for which you want data.
  • month (character) Month for which you want data.
  • hand (character) Handedness of batter. Options are "L", "R", or "B". Empty string - returns all.
  • team (character) Teams for which you want data, comma separated.
  • pageitems (character) Number of items per page.
  • pagenum (character) Page number.
  • ind (character) Whether or not to break the seasons out individual, or roll them up together. 1 = split seasons, 0 = aggregate seasons.
  • rost (character) Whether or not to include players on the roster. 1 = include, 0 = - exclude.
  • players (character) Whether or not to include players on the roster. 1 = include only active roster players, 0 = exclude.
  • type (character) Defaults to 8, which is the standard leaderboard. The values for - the leaderboards appear to go to from type = 0 to 48+, which correspond to links - on the leaderboard page.
  • postseason (logical) Whether or not to include postseason data. TRUE = include postseason, FALSE = exclude postseason.
  • sortdir (character) Sort direction. Options are "asc" or "desc" or "default".
  • sortstat (character) Sort by stat. Default is "WAR".

This change affects the following functions:

  • fg_team_batter()
  • fg_team_pitcher()
  • fg_team_fielder() (new function)
  • fg_batter_leaders()
  • fg_pitcher_leaders()
  • fg_fielder_leaders() (new function)

baseballr v1.5.0

21 Mar 18:39
Compare
Choose a tag to compare

Major NCAA function changes

New Functions

Adds the following NCAA baseball functions:

  • ncaa_teams()
  • load_ncaa_baseball_teams()
  • load_ncaa_baseball_season_ids()
  • load_ncaa_baseball_schedule()
  • load_ncaa_baseball_pbp()
  • ncaa_pbp() (see below)
  • ncaa_roster() (see below)
  • ncaa_team_player_stats() (see below)

Parameter Changes

  • ncaa_*() functions now return team_id and team_name instead of school_id and school
  • ncaa_*() functions now uniformly use team_id instead of teamid, year (vs. team_year). This affects the following functions:
  • ncaa_roster()
  • ncaa_schedule_info()
  • ncaa_park_factor()
  • ncaa_team_player_stats()
  • ncaa_lineups() function removes the year parameter (was unnecessary)
    Add proxy rlang dots option for passing httr::use_proxy()`` option to ncaa_*()``` functions

Function Aliasing

  • ncaa_baseball_pbp() has been aliased to ncaa_pbp() for naming consistency
  • ncaa_baseball_roster() has been aliased to ncaa_roster() for naming consistency
  • ncaa_scrape() has been aliased to ncaa_team_player_stats() for more descriptive naming

Notes

ncaa_schedule_info() runs much slower because it is gathering the information on all of the game play-by-play URLs for each game to get a proper game_pbp_id link as opposed to the contest_id link alone. These additional values are returned as game_pbp_id and game_pbp_url which can also now be used in the ncaa_pbp() function.

Other Fixes

  • chadwick_player_lu() function updated to address data source change
  • Under the hood fixes for mlb_venues(), fg_team_batter(), fg_team_pitcher(), fg_batter_leaders(), fg_pitcher_leaders(), chadwick_player_lu()

baseballr 1.3.0

17 Sep 13:38
Compare
Choose a tag to compare
  • Vignette contributed by @camdenk, Using Statcast Pitch Data.
  • sptrc_league_payrolls() function added (contributed by @camdenk)
  • sptrc_team_active_payrolls() function added (contributed by @camdenk)
  • fg_team_batter() function added (contributed by @camdenk)
  • fg_team_pitcher() function added (contributed by @camdenk)
  • Updates documentation per CRAN's request

baseballr 1.2.0 - Hit the CRAN, get the bands

25 Apr 13:13
Compare
Choose a tag to compare

baseballr v1.2.0 is now on CRAN

  • Removed two pitchRx-dependent functions, updated retrosheet function and documentation
  • Removed edge_scrape() and edge_scrape_split() from package. See data-raw/archived/ for the last updated script. These may be re-visited at a later date with improved data repository maturity.
  • Retrosheet functions updated to use tempdir()/tempfile() methods by default. Will need to specify a working directory to enable old functionality in which files are written to disk permanently. New default functionality is to return a named list with two tibbles per year specified: 'events' and 'rosters'.

~82 MLB Stats API functions added

name file
mlb_all_star_ballots() R/mlb_all_star_ballots.R
mlb_all_star_final_vote() R/mlb_all_star_final_vote.R
mlb_all_star_write_ins() R/mlb_all_star_write_ins.R
mlb_attendance() R/mlb_attendance.R
mlb_awards() R/mlb_awards.R
mlb_awards_recipient() R/mlb_awards_recipient.R
mlb_baseball_stats() R/mlb_baseball_stats.R
mlb_conferences() R/mlb_conferences.R
mlb_divisions() R/mlb_divisions.R
mlb_draft_latest() R/mlb_draft_latest.R
mlb_draft_prospects() R/mlb_draft_prospects.R
mlb_event_types() R/mlb_event_types.R
mlb_fielder_detail_types() R/mlb_fielder_detail_types.R
mlb_game_changes() R/mlb_game_changes.R
mlb_game_content() R/mlb_game_content.R
mlb_game_context_metrics() R/mlb_game_context_metrics.R
mlb_game_linescore() R/mlb_game_linescore.R
mlb_game_pace() R/mlb_game_pace.R
mlb_game_status_codes() R/mlb_game_status_codes.R
mlb_game_timecodes() R/mlb_game_timecodes.R
mlb_game_types() R/mlb_game_types.R
mlb_game_wp() R/mlb_game_wp.R
mlb_high_low_stats() R/mlb_high_low_stats.R
mlb_high_low_types() R/mlb_high_low_types.R
mlb_hit_trajectories() R/mlb_hit_trajectories.R
mlb_homerun_derby() R/mlb_homerun_derby.R
mlb_homerun_derby_bracket() R/mlb_homerun_derby.R
mlb_homerun_derby_players() R/mlb_homerun_derby.R
mlb_job_types() R/mlb_job_types.R
mlb_jobs() R/mlb_jobs.R
mlb_jobs_datacasters() R/mlb_jobs_datacasters.R
mlb_jobs_official_scorers() R/mlb_jobs_official_scorers.R
mlb_jobs_umpires() R/mlb_jobs_umpires.R
mlb_languages() R/mlb_languages.R
mlb_league() R/mlb_league.R
mlb_league_leader_types() R/mlb_league_leader_types.R
mlb_logical_events() R/mlb_logical_events.R
mlb_metrics() R/mlb_metrics.R
mlb_pbp_diff() R/mlb_pbp_diff.R
mlb_people() R/mlb_people.R
mlb_people_free_agents() R/mlb_people_free_agents.R
mlb_pitch_codes() R/mlb_pitch_codes.R
mlb_pitch_types() R/mlb_pitch_types.R
mlb_player_game_stats() R/mlb_player_game_stats.R
mlb_player_game_stats_current() R/mlb_player_game_stats_current.R
mlb_player_status_codes() R/mlb_player_status_codes.R
mlb_positions() R/mlb_positions.R
mlb_probables() R/mlb_probables.R
mlb_review_reasons() R/mlb_review_reasons.R
mlb_roster_types() R/mlb_roster_types.R
mlb_rosters() R/mlb_rosters.R
mlb_runner_detail_types() R/mlb_runner_detail_types.R
mlb_schedule_event_types() R/mlb_schedule_event_types.R
mlb_schedule_games_tied() R/mlb_schedule_games_tied.R
mlb_schedule_postseason() R/mlb_schedule_postseason.R
mlb_schedule_postseason_series() R/mlb_schedule_postseason_series.R
mlb_seasons() R/mlb_seasons.R
mlb_seasons_all() R/mlb_seasons_all.R
mlb_situation_codes() R/mlb_situation_codes.R
mlb_sky() R/mlb_sky.R
mlb_sports() R/mlb_sports.R
mlb_sports_info() R/mlb_sports_info.R
mlb_sports_players() R/mlb_sports_players.R
mlb_standings() R/mlb_standings.R
mlb_standings_types() R/mlb_standings_types.R
mlb_stat_groups() R/mlb_stat_groups.R
mlb_stat_types() R/mlb_stat_types.R
mlb_stats() R/mlb_stats.R
mlb_stats_leaders() R/mlb_stats_leaders.R
mlb_team_affiliates() R/mlb_team_affiliates.R
mlb_team_alumni() R/mlb_team_alumni.R
mlb_team_coaches() R/mlb_team_coaches.R
mlb_team_history() R/mlb_team_history.R
mlb_team_info() R/mlb_team_info.R
mlb_team_leaders() R/mlb_team_leaders.R
mlb_team_personnel() R/mlb_team_personnel.R
mlb_team_stats() R/mlb_team_stats.R
mlb_teams() R/mlb_teams.R
mlb_teams_stats() R/mlb_teams_stats.R
mlb_teams_stats_leaders() R/mlb_teams_stats_leaders.R
mlb_venues() R/mlb_venues.R
mlb_wind_direction_codes() R/mlb_wind_direction_codes.R
  • baseballr, as of v1.1.0, is a full MLB Stats API wrapper with access to 85+ endpoints