gameday: gameday

Description Usage Arguments Details Value Examples

View source: R/GameDay.R

Description

Convenience class for dealing with MLBAM GameDay files

Usage

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

Arguments

gameId

A valid MLBAM gameId

Details

Each gameId corresponds to one object of class 'gameday'

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 processed data set for use with openWAR containing all play-by-play information for the game indicated by the gameId

Examples

1
2
3
4
5
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)

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