Clean Play by Play DataSource:
Clean Play by Play Data
is a Data frame of play-by-play data scraped using
Additional arguments passed to a message function (for internal use).
The input Data Frame of the parameter 'pbp' with the following columns added:
Binary indicator wheter epa > 0 in the given play.
Name of the dropback player (scrambles included) including plays with penalties.
Jersey number of the passer.
Name of the rusher (no scrambles) including plays with penalties.
Jersey number of the rusher.
Name of the receiver including plays with penalties.
Jersey number of the receiver.
Binary indicator if the play was a pass play (sacks and scrambles included).
Binary indicator if the play was a rushing play.
Binary indicator if the play was a special teams play.
Binary indicator if the play ended in a first down.
Binary indicator if the play description indicates "Aborted".
Binary indicator: 1 if the play was a 'normal' play (including penalties), 0 otherwise.
ID of the player in the 'passer' column.
ID of the player in the 'rusher' column.
ID of the player in the 'receiver' column.
Name of the 'passer' if it is not 'NA', or name of the 'rusher' otherwise.
Name of the rusher on rush plays or receiver on pass plays.
ID of the rusher on rush plays or receiver on pass plays.
Name of the rusher on rush plays or receiver on pass plays (from official stats).
ID of the rusher on rush plays or receiver on pass plays (from official stats).
Jersey number of the player listed in the 'name' column.
ID of the player in the 'name' column.
= 1 if play description contains "ran ob", "pushed ob", or "sacked ob"; = 0 otherwise.
= 1 if the home team received the opening kickoff, 0 otherwise.
Build columns that capture what happens on all plays, including penalties, using string extraction from play description. Loosely based on Ben's nflfastR guide (https://www.nflfastr.com/articles/beginners_guide.html) but updated to work with the RS data, which has a different player format in the play description; e.g. 24-M.Lynch instead of M.Lynch. The function also standardizes team abbreviations so that, for example, the Chargers are always represented by 'LAC' regardless of which year it was.
For information on parallel processing and progress updates please see nflfastR.