updateGame: Update data for a single game from GameDay

Description Usage Arguments Details Value Examples

Description

Replaces data from a single game.

Usage

1
updateGame(gameIds, data, ...)

Arguments

gameIds

A character vector of valid MLBAM gameIds

data

a data.frame returned by getData

...

currently ignored

Details

Deletes and then appends fresh information from a particular game to the original data.

Value

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

Examples

1
2
3
4
5
6
7
data(May)
dim(May)
tail(May)
newMay <- updateGame(gameIds = 'gid_2013_05_14_kcamlb_anamlb_1', data = May)
dim(newMay)
# the replaced games are now at the bottom of the data frame
tail(newMay)

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