GameDayPlays: An object containing play-by-play data

Description Usage Arguments Format Examples

Description

A data set that contains play-by-play information returned by getData

Usage

1

Arguments

x

an object

Format

A GameDayPlays object. This is a tbl_df and data.frame with 62 columns. The columns are as follows:

pitcherId

The MLBAM id of the pitcher

batterId

The MLBAM id of the batter

field_teamId

The MLBAM id of the fielding team

ab_num

The chronological number of the plate appearance

inning

The inning number

half

Indicates which half of the inning (i.e. top or bottom)

balls

The number of balls at the end of the plate appearance

strikes

The number of strikes at the end of the plate appearance

endOuts

The number of outs at the end of the plate appearance

event

The result of the plate appearance (e.g. Single, Walk, Grounded Into DP)

actionID

NA

description

A description of the result of the plate appearance

stand

The handedness of the batter during the plate appearance

throws

The handedness of the pitcher

runnerMovement

A coded description of movement of all base runners during the plate appearance

x

For balls in play, the MLBAM x-coordinate of where the ball is first touched. Note that 0 is the far left hand edge of the stadium image file. (NA for balls not in play)

y

For balls in play, the MLBAM y-coordinate of where the ball is first touched. Note that 0 is the top of the stadium image file. (NA for balls not in play)

game_type

Game type

home_team

The MLBAM home team abbreviation

home_teamId

The MLBAM id of the home team

home_lg

The league of the home team (i.e. AL or NL)

away_team

The MLBAM away team abbreviation

away_teamId

The MLBAM id of the away team

away_lg

The league of the away team (i.e. AL or NL)

venueId

The MLBAM park id

stadium

The name of the stadium where the game is being played

timestamp

The timestamp associated withe the plate appearance

playerId.C

The MLBAM of the catcher

playerId.1B

The MLBAM of the first baseman

playerId.2B

The MLBAM of the second baseman

playerId.3B

The MLBAM of the third baseman

playerId.SS

The MLBAM of the shortstop

playerId.LF

The MLBAM of the left fielder

playerId.CF

The MLBAM of the center fielder

playerId.RF

The MLBAM of the right fielder

batterPos

The defensive postion of the current batter

batterName

The name of the current batter

pitcherName

The name of the current pitcher

runsOnPlay

The number of runs that were scored as a result of the plate appearance

startOuts

The number of outs at the beginning of the plate appearnace

runsInInning

The total number of runs scored in the half of an inning

runsITD

The total number of runs that have been scored in the half of an inning prior to the current plate appearance

runsFuture

The total number of runs that are scored in the half of an inning that were scored after the current plate appearance

startCode

Binary representation of the base runner configuration at the start of the plate appearance

endCode

Binary representation of the base runner configuration at the end of the plate appearance

fielderId

For a ball in play, the MLBAM id of the fielder who first touches the baseball. (NA for balls not in play)

endCode

Binary representation of the base runner configuration at the end of the plate appearance

gameId

The MLBAM id for this game

isPA

Boolean indicating if the plate appearance was a plate appearance

isAB

Boolean indicating if the plate appearance was an at bat

isHit

Boolean indicating if the plate appearance resulted in a hit

isBIP

Boolean indicating if the plate appearance resulted in a ball in play

our.x

Horizontal coordinate, in feet, of where the ball landed. Home plate has our.x of 0.

out.y

Vertical coordinate, in feet, of where the ball landed. Home plate has our.y of 0.

r

radial distance, in feet, of the location of the batted ball. Home plate has r of 0.

theta

radial angle, in radians, of the location of the batted ball. Home plate has theta of 0.

Examples

1

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