Learn R Programming

openWAR (version 0.2.2.9001)

updateGame: updateGame

Description

Replaces data from a single game

Usage

updateGame(gameIds, data, ...)

Arguments

gameIds

A character vector of valid MLBAM gameIds

data

a data.frame returned by getData

...

currently ignored

Value

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

Details

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

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab