gameday: Convenience class for dealing with MLBAM GameDay files

Description Usage Arguments Details Value Examples

Description

Each gameId corresponds to one object of class gameday

Usage

1
gameday(gameId = "gid_2012_08_12_atlmlb_nynmlb_1", ...)

Arguments

gameId

A valid MLBAM gameId

...

currently ignored

Details

A gameday object is a list containing 4 elements: gameId, base, url, and ds. gameId is the unique identifier for a game, base contains the base URL corresponding the the gameId, url contains the sub urls pointing to different data sets that are combined together to create an object of class GameDayPlays containing play-by-play data. The ds slot of the list contains the GameDayPlays object of play-by-play data.

Value

An object of class gameday, which consists of a list containing

gameId

The ID of the game (e.g. 'gid_2012_08_12_atlmlb_nynmlb_1')

base

The base URL for the game (e.g. 'http://gd2.mlb.com/components/game/mlb/year_2012/month_08/day_12/')

url

A character vector containing the names of the XML files downloaded from the GameDay server

ds

The GameDayPlays object for use with openWAR containing all play-by-play information for the game indicated by the gameId

Examples

1
2
3
4
5
6
exampleGameday <- gameday(gameId = 'gid_2012_08_12_atlmlb_nynmlb_1')
# Display GameId
exampleGameday$gameId
# Summary of the different types of game events for gameId = 'gid_2012_08_12_atlmlb_nynmlb_1'
summary(exampleGameday$ds$event)
plot(exampleGameday$ds)

beanumber/openWAR documentation built on May 12, 2019, 9:43 a.m.