helper that loads multiple seasons from the data repo either into memory or writes it into a db using some forwarded arguments in the dots
load_wnba_pbp(
seasons = most_recent_wnba_season(),
...,
dbConnection = NULL,
tablename = NULL
)
A dataframe with 42 columns
Logical value (TRUE/FALSE) indicating whether the play was a shooting play
Sequence number is supposed to represent a shot-possession, examine the last two numbers to see if there are multiple events that occur within the same shot-possession. A shot-possession is basically any sequence of plays until there is a shot, change in possession, and probably things like technical fouls and the like. So as soon as a shot goes up, a new sequence starts regardless, even if the shooting team retains possession via offensive or deadball rebound. The first portion of the number is usually time related (i.e. the numeric representation of when the sequence started, from a seconds remaining in the period perspective or so)
Long form of period (1st quarter, 2nd Quarter, OT, etc.)
The numeric period of play in the game
Home score at the time of the play
The entire scale is a rectangle of size 25x47, intended as a half-court representation of the basketball court (i.e. on the side of the offense), with each coordinate unit representing a foot. It appears that the basket is roughly represented as the (25, 0) point. This is a nonsensical definition when considering that the basket overhangs the court, with the backboard aligned 48 inches from the baseline, then the center of the hoop being roughly 11 inches from there. This is an idiosyncracy of either sensor placement or software and data entry. Use your best judgement in making your charts, I think you will find that making some translations will be helpful.
Logical value (TRUE/FALSE) indicating whether the play was a play on which the offense scored
Time left within the period
Unique team identification number for the offensive team
Unique play type identifcation number
Play type text description
Away score at the time of the play
Unique play identifcation number
Text description of the play
The points value of the shot taken
Unique player identification number
Unique player identification number
Unique player identification number
Play type abbreviation
Season of the game
Season type of the game, 1 is pre-season, 2 is regular season, 3 is post-season, 4 is off-season
Unique away team identification number
Away team name
Away team mascot
Text abbreviation for the away team
Alternate versions of the away team abbreviation
Unique home team identification number
home team name
home team mascot
Text abbreviation for the home team
Alternate versions of the home team abbreviation
The game spread with respect to the home team
Game spread in (-X Team) format. There are almost none, I would recommend not trusting any of these three columns
Logical (TRUE/FALSE) indicating whether the home team is favored
Clock minutes split from seconds for developer convenience
Clock seconds split from minutes for developer convenience
Half of the game
A lag column on the half
A lead column on the half
Game play number
Unique identifier for the game event
A vector of 4-digit years associated with given WNBA seasons. (Min: 2002)
Additional arguments passed to an underlying function that writes
the season data into a database (used by update_wnba_db()
).
A DBIConnection
object, as returned by DBI::dbConnect()
The name of the play by play data table within the database
# \donttest{
try(load_wnba_pbp())
# }
Run the code above in your browser using DataLab