Skip to contents

PWHL Play-by-play

Usage

pwhl_pbp(game_id)

Arguments

game_id

Game ID that you want play-by-play for

Value

A data frame (fastRhockey_data) with the following columns:

col_nametypesdescription
game_idnumericUnique game identifier.
eventcharacterEvent type (faceoff, shot, goal, penalty, blocked_shot, hit, etc.).
team_idnumericUnique team identifier for the event.
period_of_gamecharacterPeriod number within the game.
time_of_periodcharacterElapsed time within the period (MM:SS).
player_idintegerPrimary player's unique identifier.
player_name_firstcharacterPrimary player first name.
player_name_lastcharacterPrimary player last name.
player_positioncharacterPrimary player position.
player_two_idintegerSecond player's unique identifier.
player_two_name_firstcharacterSecond player first name.
player_two_name_lastcharacterSecond player last name.
player_two_positioncharacterSecond player position.
x_coordnumericTransformed x-coordinate of the event (feet scale).
y_coordnumericTransformed y-coordinate of the event (feet scale).
home_winnumericWhether the home player won the faceoff.
player_team_idnumericUnique team identifier of the primary player.
event_typecharacterDetailed event sub-type (shot type, penalty type).
shot_qualitycharacterShot quality rating.
goallogicalWhether the shot resulted in a goal.
goalie_idintegerGoalie's unique identifier.
goalie_firstcharacterGoalie first name.
goalie_lastcharacterGoalie last name.
penalty_lengthcharacterPenalty length in minutes.
power_playnumericWhether the event occurred on a power play.
player_three_idintegerThird player's unique identifier.
player_three_name_firstcharacterThird player first name.
player_three_name_lastcharacterThird player last name.
player_three_positioncharacterThird player position.
empty_netcharacterWhether the goal was scored on an empty net.
game_winnercharacterWhether the goal was the game-winning goal.
penalty_shotcharacterWhether the goal came on a penalty shot.
insurancecharacterWhether the goal was an insurance goal.
short_handedcharacterWhether the event occurred while short-handed.
plus_player_one_idintegerOn-ice plus player one unique identifier.
plus_player_one_firstcharacterOn-ice plus player one first name.
plus_player_one_lastcharacterOn-ice plus player one last name.
plus_player_one_positioncharacterOn-ice plus player one position.
plus_player_two_idintegerOn-ice plus player two unique identifier.
plus_player_two_firstcharacterOn-ice plus player two first name.
plus_player_two_lastcharacterOn-ice plus player two last name.
plus_player_two_positioncharacterOn-ice plus player two position.
plus_player_three_idintegerOn-ice plus player three unique identifier.
plus_player_three_firstcharacterOn-ice plus player three first name.
plus_player_three_lastcharacterOn-ice plus player three last name.
plus_player_three_positioncharacterOn-ice plus player three position.
plus_player_four_idintegerOn-ice plus player four unique identifier.
plus_player_four_firstcharacterOn-ice plus player four first name.
plus_player_four_lastcharacterOn-ice plus player four last name.
plus_player_four_positioncharacterOn-ice plus player four position.
plus_player_five_idintegerOn-ice plus player five unique identifier.
plus_player_five_firstcharacterOn-ice plus player five first name.
plus_player_five_lastcharacterOn-ice plus player five last name.
plus_player_five_positioncharacterOn-ice plus player five position.
minus_player_one_idintegerOn-ice minus player one unique identifier.
minus_player_one_firstcharacterOn-ice minus player one first name.
minus_player_one_lastcharacterOn-ice minus player one last name.
minus_player_one_positioncharacterOn-ice minus player one position.
minus_player_two_idintegerOn-ice minus player two unique identifier.
minus_player_two_firstcharacterOn-ice minus player two first name.
minus_player_two_lastcharacterOn-ice minus player two last name.
minus_player_two_positioncharacterOn-ice minus player two position.
minus_player_three_idintegerOn-ice minus player three unique identifier.
minus_player_three_firstcharacterOn-ice minus player three first name.
minus_player_three_lastcharacterOn-ice minus player three last name.
minus_player_three_positioncharacterOn-ice minus player three position.
minus_player_four_idintegerOn-ice minus player four unique identifier.
minus_player_four_firstcharacterOn-ice minus player four first name.
minus_player_four_lastcharacterOn-ice minus player four last name.
minus_player_four_positioncharacterOn-ice minus player four position.
minus_player_five_idintegerOn-ice minus player five unique identifier.
minus_player_five_firstcharacterOn-ice minus player five first name.
minus_player_five_lastcharacterOn-ice minus player five last name.
minus_player_five_positioncharacterOn-ice minus player five position.
game_datecharacterGame date.
game_seasonnumericSeason (concluding year, YYYY).
game_season_idcharacterSeason identifier.
home_team_idintegerHome team unique identifier.
home_teamcharacterHome team name.
away_team_idintegerAway team unique identifier.
away_teamcharacterAway team name.
x_coord_originalintegerOriginal raw x-coordinate from the feed.
y_coord_originalintegerOriginal raw y-coordinate from the feed.
x_coord_neutralnumericNeutral-zone-centered x-coordinate.
y_coord_neutralnumericNeutral-zone-centered y-coordinate.
x_coord_fixednumericFixed-projection x-coordinate.
y_coord_fixednumericFixed-projection y-coordinate.
x_coord_rightnumericRight-oriented x-coordinate.
y_coord_rightnumericRight-oriented y-coordinate.
x_coord_verticalnumericVertical-projection x-coordinate.
y_coord_verticalnumericVertical-projection y-coordinate.
minute_startnumericMinute mark of the period when the event started.
second_startnumericSecond mark of the period when the event started.
clockcharacterGame clock time remaining (MM:SS).
sec_from_startnumericSeconds elapsed since the start of the game.
shot_distancenumericDistance from the net in feet (shot/blocked_shot/goal events).
shot_anglenumericAngle from the net in degrees (shot/blocked_shot/goal events).
scoring_chancelogicalTRUE when event is a shot-type within 25 ft of the net.
on_ice_homecharacterComma-joined sorted player_ids on ice for the home team.
on_ice_awaycharacterComma-joined sorted player_ids on ice for the away team.

Examples

# \donttest{
try(pwhl_pbp(game_id = 27))
#> ── PWHL Play-by-Play data from HockeyTech ───────────────── fastRhockey 1.0.0 ──
#>  Data updated: 2026-06-09 20:30:08 UTC
#> # A tibble: 114 × 100
#>    game_id event team_id period_of_game time_of_period x_coord y_coord player_id
#>      <dbl> <chr> <chr>   <chr>          <chr>            <dbl>   <dbl>     <int>
#>  1      27 goal… 1       1              0:00              NA     NA           NA
#>  2      27 goal… 3       1              0:00              NA     NA           NA
#>  3      27 face… NA      1              0:00               0      0           15
#>  4      27 face… NA      1              0:31              52.3   28.6         15
#>  5      27 shot  3       1              1:14              60     17           84
#>  6      27 face… NA      1              1:22             -66.7  -15.9        109
#>  7      27 face… NA      1              1:58             -32.3  -21.8          4
#>  8      27 shot  1       1              3:49             -58.7  -12.8        167
#>  9      27 shot  3       1              4:27              65.3   11.0         84
#> 10      27 shot  3       1              4:41              51      1.42        32
#> # ℹ 104 more rows
#> # ℹ 92 more variables: player_name_first <chr>, player_name_last <chr>,
#> #   player_position <chr>, goal <lgl>, goalie_id <int>, goalie_first <chr>,
#> #   goalie_last <chr>, home_win <chr>, player_team_id <chr>, event_type <chr>,
#> #   shot_quality <chr>, player_two_id <int>, player_two_name_first <chr>,
#> #   player_two_name_last <chr>, player_two_position <chr>,
#> #   penalty_length <chr>, power_play <chr>, empty_net <chr>, …
# }