Learn R Programming

baseballr (version 0.3.3)

scrape_statcast_savant: Query Statcast and PITCHf/x Data for data from baseballsavant.mlb.com

Description

This function allows you to query Statcast and PITCHf/x data as provided on baseballsavant.mlb.com and have that data returned as a dataframe.

Usage

scrape_statcast_savant(start_date, end_date, playerid = NULL,
  player_type = 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 who's data you want to query.

player_type

The player type. Can be 'batter' or 'pitcher'

Examples

Run this code
# NOT RUN {
scrape_statcast_savant(start_date = "2016-04-06", end_date = "2016-04-15", playerid = 621043, player_type='batter')

scrape_statcast_savant(start_date = "2016-04-06", end_date = "2016-04-15", playerid = 592789, player_type='pitcher')

scrape_statcast_savant(start_date = "2016-04-06", end_date = "2016-04-06")
# }

Run the code above in your browser using DataLab