Retrieves MLBAM GameDay files for a specified time interval using
multiple calls of the gameday
function.
getData(start = Sys.Date() - 1, end = NULL, gameIds = NULL,
drop.suspended = TRUE)getDataMonthly(yyyy = 2013, m = 5)
getDataWeekly(start = Sys.Date() - 8)
A valid date in yyyy-mm-dd format (default is Sys.Date() - 1
(i.e. yesterday))
A valid date in yyyy-mm-dd format (default is NULL
, which then uses the same value as start
(i.e. yesterday))
a vector of specific gameIds that you want to retrieve. If NULL (the default), then the dates are used to fetch the relevant gameIds
Logical indicating whether games with fewer than 5 innings should be excluded. Default is TRUE
.
A year
A numeric value corresponding to a month
A tbl_df
of class GameDayPlays
consisting of play-by-play data
Given a beginning and end date, this function will retrieve all data from the MLBAM GameDay server in the specified interval and process them into a single data frame.
# NOT RUN {
# Get data from one day
ds = getData(start = '2013-03-31')
# Get data from multiple days
# }
# NOT RUN {
ds = getData(start = '2013-03-31', end = '2013-04-02')
# }
# NOT RUN {
# Get data for entire 2013 season
# }
# NOT RUN {
ds = getData(start = '2013-03-31', end = '2013-09-30')
# }
# NOT RUN {
# Retrieve all of the MLBAM data from May 2013
# }
# NOT RUN {
# ds = getDataMonthly(2013, 5)
# }
# NOT RUN {
# Retrieve all the data from the first week of the 2013 season
# }
# NOT RUN {
ds = getDataWeekly('2013-03-31')
# }
Run the code above in your browser using DataLab