Helper that loads multiple seasons of NHL goal-scoring event data from the sportsdataverse-data releases.
Usage
load_nhl_scoring(
seasons = most_recent_nhl_season(),
...,
dbConnection = NULL,
tablename = NULL
)Arguments
- seasons
A vector of 4-digit years (the end year of the NHL season; e.g., 2026 for the 2025-26 season). Min: 2011.
- ...
Additional arguments passed to an underlying function.
- dbConnection
A
DBIConnectionobject, as returned byDBI::dbConnect()- tablename
The name of the data table within the database
Value
A data frame (fastRhockey_data) with one row per goal and the
following columns:
| col_name | types | description |
| situationCode | character | Strength/situation code for the goal. |
| eventId | integer | NHL event identifier. |
| strength | character | Strength state at which the goal was scored. |
| playerId | integer | Player id of the goal scorer. |
| firstName | list | Scorer first name (localized list). |
| lastName | list | Scorer last name (localized list). |
| name | list | Scorer display name (localized list). |
| teamAbbrev | list | Scoring team abbreviation (localized list). |
| headshot | character | URL to the scorer headshot image. |
| highlightClipSharingUrl | character | Shareable URL for the goal highlight clip. |
| highlightClip | numeric | Highlight clip identifier. |
| discreteClip | numeric | Discrete clip identifier. |
| goalsToDate | integer | Scorer goal total to date in the season. |
| awayScore | integer | Away team score after the goal. |
| homeScore | integer | Home team score after the goal. |
| leadingTeamAbbrev | list | Abbreviation of the leading team (localized list). |
| timeInPeriod | character | Time within the period the goal was scored. |
| shotType | character | Type of shot on the goal. |
| goalModifier | character | Goal modifier (e.g. empty-net, power-play). |
| assists | list | List of assisting players on the goal. |
| pptReplayUrl | character | URL to the power-play replay, if any. |
| homeTeamDefendingSide | character | Side of the ice the home team defended. |
| isHome | logical | Whether the scoring team is the home team. |
| period_number | integer | Period number the goal was scored in. |
| period_type | character | Period type (REG/OT/SO). |
Examples
# \donttest{
try(load_nhl_scoring(2026))
#> ── NHL scoring summary ──────────────────────────────────── fastRhockey 1.0.0 ──
#> ℹ Data updated: 2026-07-22 23:49:22 UTC
#> # A tibble: 8,691 × 48
#> situationCode eventId strength playerId firstName.default firstName.cs
#> <chr> <int> <chr> <int> <chr> <chr>
#> 1 1551 258 ev 8483493 Frank NA
#> 2 1551 274 ev 8478421 A.J. NA
#> 3 1451 366 pp 8477409 Carter NA
#> 4 1551 630 ev 8476882 Teuvo NA
#> 5 1551 1101 ev 8480003 Jesper NA
#> 6 1551 481 ev 8479638 Justin NA
#> 7 1560 1123 ev 8479638 Justin NA
#> 8 1560 112 ev 8481481 Blake NA
#> 9 1551 562 ev 8480039 Martin NA
#> 10 1551 647 ev 8484258 Sam NA
#> # ℹ 8,681 more rows
#> # ℹ 42 more variables: firstName.de <chr>, firstName.es <chr>,
#> # firstName.fi <chr>, firstName.sk <chr>, firstName.sv <chr>,
#> # firstName.fr <chr>, lastName.default <chr>, lastName.cs <chr>,
#> # lastName.fi <chr>, lastName.sk <chr>, lastName.de <chr>, lastName.es <chr>,
#> # lastName.sv <chr>, name.default <chr>, name.cs <chr>, name.de <chr>,
#> # name.fi <chr>, name.sk <chr>, name.sv <chr>, teamAbbrev.default <chr>, …
# }
