Skip to contents

Retrieves G-League play-by-play using the NBA Stats play-by-play pipeline.

Usage

nbagl_pbp(game_id, on_court = TRUE, ...)

Arguments

game_id

Game ID - 10 digits, i.e. 0021900001

on_court

If TRUE (default), on-court player IDs are added for each play event.

...

Additional arguments passed to an underlying function like httr.

Value

Returns a data frame of play-by-play with core columns: When on_court = TRUE, lineup columns are included and may be NA when lineup inference data is unavailable for a given game.

col_nametypesdescription
game_idcharacterUnique game identifier.
action_numberintegerSequential action number within a game (V3 PBP).
clockcharacterGame clock value.
periodintegerPeriod of the game (1-4 quarters; 5+ for OT).
team_idintegerUnique team identifier.
person_idintegerUnique player identifier (V3 endpoints).
player_namecharacterPlayer name.
x_legacyintegerV2-format X coordinate (preserved for V3-to-V2 compatibility).
y_legacyintegerV2-format Y coordinate (preserved for V3-to-V2 compatibility).
shot_distancenumericShot distance from the basket, in feet.
shot_resultcharacterShot result ('Made' / 'Missed').
is_field_goalinteger1 if the action was a field goal; 0 otherwise.
score_homecharacterScore home.
score_awaycharacterScore away.
points_totalintegerRunning total of points scored.
locationcharacterLocation.
descriptioncharacterLong-form description text.
action_typecharacterAction type label (e.g. 'Made Shot', 'Substitution').
sub_typecharacterAction sub-type label.
video_availablelogicalVideo available.
shot_valueintegerPoint value of the shot (2 or 3).
action_idintegerUnique action identifier within a game (V3 PBP).
away_player1numericAway team's player1.
away_player2numericAway team's player2.
away_player3numericAway team's player3.
away_player4numericAway team's player4.
away_player5numericAway team's player5.
home_player1numericHome team's player1.
home_player2numericHome team's player2.
home_player3numericHome team's player3.
home_player4numericHome team's player4.
home_player5numericHome team's player5.

Details

 nbagl_pbp(game_id = "2052500034")

Author

Billy Fryer