Learn R Programming

openWAR (version 0.2.2.9001)

gameday: gameday

Description

Convenience class for dealing with MLBAM GameDay files

Usage

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

Arguments

gameId

A valid MLBAM gameId

...

currently ignored

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

Details

Each gameId corresponds to one object of class gameday

Examples

Run this code
# NOT RUN {
exampleGameday <- gameday(gameId = 'gid_2012_08_12_atlmlb_nynmlb_1')
# Display GameId
exampleGameday$gameId
# Summary of the different types fo game events for gameId = 'gid_2012_08_12_atlmlb_nynmlb_1'
summary(exampleGameday$ds$event)
plot(exampleGameday$ds)
# }

Run the code above in your browser using DataLab