Skip to contents

Players on the ice at each goal of one game (onlajny ids), from the full play-by-play (match/{season - 1}/full/{match_id}.json). A goal entry's on-ice block lists both teams' skaters and goalies (up to six players each) and the strength. Every player is a row tagged with the scoring team, so plus/minus and on-ice counts fall out of a group-by. A goal without that block (every 2016-17 goal) is ONE row with NA on-ice columns, so no goal is dropped.

Usage

elh_pbp_goals(season, match_id, return_parsed = TRUE)

Arguments

season

Season by its END year (2027 = 2026-27); the bucket files it under the START year (match/2026/), mapped here. Play-by-play starts in 2014-15 (season 2015).

match_id

hokej.cz game id (the S3 file name; hokejcz_game_id of elh_game_ids() / elh_scoreboard()), e.g. 2928321. Not the onlajny game id.

return_parsed

Parse the payload into a tibble (default TRUE). Pass FALSE for the raw JSON as a list (XML-converted: every attribute a string).

Value

A tibble (return_parsed = TRUE; goals oldest first, players in team then slot order; zero rows for a malformed body), else the raw JSON list:

col_nametypedescription
comment_idintegerOnlajny commentary entry id (integer); equals the mobile file's comment id.
event_idintegerOnlajny event id of a goal or penalty (integer); null on other entries.
clockcharacterElapsed game clock mm:ss (00:01 = game start); null on a clockless entry.
game_secondsintegerSeconds from the start of the game.
periodintegerPeriod number derived from the game clock (20-minute periods; 4 = overtime); null on a clockless entry.
strengthcharacterStrength of a goal: EQ (read as even strength; inferred, the only value observed). Null where the on-ice block is absent (all of 2016-17).
home_scoreintegerHome goals (after the entry on play-by-play rows; final on the scoreboard).
away_scoreintegerAway goals (after the entry on play-by-play rows; final on the scoreboard).
scoring_onlajny_team_idintegerOnlajny team id of the scoring team.
scoring_team_codecharacterTeam code of the scoring team, e.g. SPA.
on_ice_onlajny_team_idintegerOnlajny team id of the on-ice player's team; null for a goal without the on-ice block (2016-17).
on_ice_team_codecharacterTeam code of the on-ice player's team.
is_scoring_teamlogicalTrue when the on-ice player is on the scoring team.
slotintegerPlayer slot within the team's on-ice block (1-6).
onlajny_player_idintegerOnlajny player id of the on-ice player (per competition, inferred); NOT the hokej.cz player id of the shots.
onlajny_player_global_idintegerOnlajny GLOBAL player id of the on-ice player; can differ from onlajny_player_id for the same player.
player_namecharacterOn-ice player's display name (surname).

Errors

As elh_pbp().

Examples

# \donttest{
  try(elh_pbp_goals(season = 2027, match_id = 2928321))
#> ── ELH Pbp Goals Information from hokej.cz ─────────── fastRhockey 1.0.0.9000 ──
#> ℹ Data updated: 2026-10-13 01:52:00 UTC
#> # A tibble: 36 × 17
#>    comment_id event_id clock game_seconds period strength home_score away_score
#>         <int>    <int> <chr>        <int>  <int> <chr>         <int>      <int>
#>  1   70328418 13774488 05:06          306      1 EQ                1          0
#>  2   70328418 13774488 05:06          306      1 EQ                1          0
#>  3   70328418 13774488 05:06          306      1 EQ                1          0
#>  4   70328418 13774488 05:06          306      1 EQ                1          0
#>  5   70328418 13774488 05:06          306      1 EQ                1          0
#>  6   70328418 13774488 05:06          306      1 EQ                1          0
#>  7   70328418 13774488 05:06          306      1 EQ                1          0
#>  8   70328418 13774488 05:06          306      1 EQ                1          0
#>  9   70328418 13774488 05:06          306      1 EQ                1          0
#> 10   70328418 13774488 05:06          306      1 EQ                1          0
#> # ℹ 26 more rows
#> # ℹ 9 more variables: scoring_onlajny_team_id <int>, scoring_team_code <chr>,
#> #   on_ice_onlajny_team_id <int>, on_ice_team_code <chr>,
#> #   is_scoring_team <lgl>, slot <int>, onlajny_player_id <int>,
#> #   onlajny_player_global_id <int>, player_name <chr>
# }