getData: getData

Description Usage Arguments Details Value Examples

View source: R/getData.R

Description

Retrieves MLBAM GameDay files for a specified time interval using multiple calls of the gameday function.

Usage

1
2
getData(start = Sys.Date() - 1, end = NULL, gameIds = NULL,
  drop.suspended = TRUE)

Arguments

start

A valid date in yyyy-mm-dd format (default yesterday)

end

A valid date in yyyy-mm-dd format (default start)

drop.suspended

Logical indicating whether games with fewer than 5 innings should be excluded

Details

Given a beginning and end date, this function will retrieve all data from the MLABM GameDay server in the specified interval and process them into a single data.frame.

Value

A data.frame of class 'GameDayPlays' consisting of play-by-play data

Examples

1
2
3
4
5
6
# Get data from one day
ds = getData(start = '2013-03-31')
# Get data from multiple days
ds = getData(start = '2013-03-31', end = '2013-04-02')
# Get data for entire 2013 season
# ds = getData(start = '2013-03-31', end = '2013-09-30')

frogman141/openWAR documentation built on Dec. 20, 2021, 8:52 a.m.