Scrapes play-by-play data for a specified game ID.
scrape_game(game_id)
Game ID to scrape
A tibble containing event-based play-by-play data for an individual NHL game. The resulting data will have columns for:
Numeric expected goal value for unblocked shot events
String defining the event
String with alternate event definition; in all caps
String defining secondary event type
String defining the primary team involved in the event
String indicator of event team type: home or away
String detailed description of event
Integer value of the game period
Numeric value of the seconds into the period of the event
Numeric value of the seconds remaining in the period
Numeric value of the seconds into the game of the event
Numeric value of the seconds remaining in the game; negative for overtime periods
Integer value of the home team score after the event
Integer value of the away team score after the event
String name of the primary event player
String indicator for the role of event_player_1
String name of the secondary event player
String indicator for the role of event_player_2
String name of the tertiary event player
String indicator for the role of event_player_3
String name of the goalie involved in the event
String indicator for game strength: EV, SH, or PP
String name for game strength: Even, Shorthanded, or Power Play
String name for detailed game strength in the form of '(event team skaters)v(opponent skaters)'
Integer value of the penalty minutes on penalty events
String name for penalty severity: Minor or Major
Integer value of the number of skaters substituted on during a shift change event
String of player names substituted on during a shift change event
Integer value of the number of skaters substituted off during a shift change event
String of player names substituted off during a shift change event
Logical indicator of whether or not the event team had their goalie pulled
Numeric x-coordinate of event in feet, with origin at center ice
Numeric y-coordinate of event in feet, with origin at center ice
Numeric transformed x-coordinate of event in feet, where the home team always shoots to the right, away team to the left
Numeric transformed y-coordinate of event in feet, where the home team always shoots to the right, away team to the left
Numeric distance (in feet) to center of net for unblocked shot events
Numeric angle (in degrees) to center of net for unlocked shot events
Numeric value for number of skaters on the ice for the home team, excluding the goalie
Numeric value for number of skaters on the ice for the away team, excluding the goalie
String name of home team player on ice
String name of home team player on ice
String name of home team player on ice
String name of home team player on ice
String name of home team player on ice
String name of home team player on ice
String name of home team player on ice
String name of away team player on ice
String name of away team player on ice
String name of away team player on ice
String name of away team player on ice
String name of away team player on ice
String name of away team player on ice
String name of away team player on ice
String name of home goalie on ice
String name of away goalie on ice
Integer value of assigned game ID
Numeric index for event
Numeric id for event -- more specified than event_idx
Integer value of the player ID for the primary event player
String value of the NHL.com player link for the primary event player
Integer value for the total events for the primary event player this season
Integer value of the player ID for the secondary event player
String value of the NHL.com player link for the secondary event player
Integer value for the total events for the secondary event player this season
Integer value of the player ID for the tertiary event player
String value of the NHL.com player link for the tertiary event player
Integer value for the total events for the tertiary event player this season
Integer value of the player ID for the event goalie
String value of the NHL.com player link for the event goalie
String indicator for the role of the event_goalie
Logical indicator of whether or not the goal scored was the game-winning goal
Logical indicator of whether or not the goal scored was on an empty net
String name of period type: REGULAR, OVERTIME, or SHOOTOUT
String name of the ordinal period: 1st, 2nd, 3rd, 4th...
String value of the time into the period of the event
String value of the time remaining in the period
String value of the real-world timestamp of the event
Integer value of the NHL ID of event_team
String value of the NHL.com team link for the event_team
String value of the 3-letter NHL abbreviation for the event_team
Integer value of the final score for the home team
Integer value of the final score for the away team
String value of the official NHL season
String indicator of season type: R, or P
Date of game
Date time of start of game in US/Eastern time zone
Date time of end of game in US/Eastern time zone
Period value of length of game, in hours:minutes
String indicator of state of game
String indicator of detailed game state
Integer value of the NHL ID for the venue
String name of the game venue
String value of the NHL.com link for the venue
String name of the home team
String value of the 3-letter NHL abbreviation of the home team
String value of the name of the NHL division of the home team
String value of the name of the NHL conference of the home team
Integer value of the NHL ID of the home team
String name of the away team
String value of the 3-letter NHL abbreviation of the away team
String value of the name of the NHL division of the away team
String value of the name of the NHL conference of the away team
Integer value of the NHL ID of the away team
if (FALSE) {
pbp <- scrape_game(2020020420)
}