Skip to contents

Returns per-team-name totals from the NHL Records API (https://records.nhl.com/site/api/franchise-team-totals). Useful for relocated franchises where multiple team names map to one franchise.

Usage

nhl_records_franchise_team_totals(franchise_id = NULL, cayenne_exp = NULL)

Arguments

franchise_id

Optional integer franchise ID. When supplied it is translated into a cayenneExp=franchiseId={franchise_id} filter unless cayenne_exp is already provided.

cayenne_exp

Optional Cayenne filter expression string. Takes precedence over franchise_id when both are supplied.

Value

A data frame (fastRhockey_data) with the following columns:

col_nametypesdescription
idintegerUnique record identifier.
active_franchiseintegerIndicator of whether the franchise is active.
active_teamlogicalIndicator of whether the team is active.
cupsintegerNumber of Stanley Cup championships.
first_season_idintegerSeason ID of the team's first season.
franchise_idintegerUnique franchise identifier.
game_type_idintegerGame type the totals belong to.
game_win_pctgnumericGame-winning percentage.
games_playedintegerTotal games played.
goals_againstintegerGoals against.
goals_forintegerGoals for.
home_lossesintegerLosses at home.
home_overtime_lossesintegerOvertime losses at home.
home_tiesintegerTies at home.
home_winsintegerWins at home.
last_season_idintegerSeason ID of the team's last season.
lossesintegerTotal losses.
overtime_lossesintegerTotal overtime losses.
penalty_minutesintegerPenalty minutes.
playoff_seasonsintegerNumber of playoff seasons.
point_pctgnumericPoints percentage.
pointsintegerTotal standings points.
road_lossesintegerLosses on the road.
road_overtime_lossesintegerOvertime losses on the road.
road_tiesintegerTies on the road.
road_winsintegerWins on the road.
series_lossesintegerPlayoff series losses.
series_playedintegerPlayoff series played.
series_win_pctgnumericPlayoff series win percentage.
series_winsintegerPlayoff series wins.
shootout_lossesintegerShootout losses.
shootout_winsintegerShootout wins.
shutoutsintegerShutouts recorded.
team_idintegerUnique team identifier.
team_namecharacterTeam name.
tiesintegerTotal ties.
tri_codecharacterTeam three-letter code.
winsintegerTotal wins.

Examples

# \donttest{
  try(nhl_records_franchise_team_totals())
#> ── NHL Records Franchise Team Totals ────────────────────── fastRhockey 1.0.0 ──
#>  Data updated: 2026-06-13 03:25:40 UTC
#> # A tibble: 120 × 38
#>       id active_franchise active_team  cups first_season_id franchise_id
#>    <int>            <int> <lgl>       <int>           <int>        <int>
#>  1     1                1 TRUE            3        19821983           23
#>  2     2                1 TRUE            3        19821983           23
#>  3     3                1 TRUE            4        19721973           22
#>  4     4                1 TRUE            4        19721973           22
#>  5     5                1 TRUE            4        19261927           10
#>  6     6                1 TRUE            4        19261927           10
#>  7     7                1 TRUE            2        19671968           16
#>  8     8                1 TRUE            2        19671968           16
#>  9     9                1 TRUE            5        19671968           17
#> 10    10                1 TRUE            5        19671968           17
#> # ℹ 110 more rows
#> # ℹ 32 more variables: game_type_id <int>, game_win_pctg <dbl>,
#> #   games_played <int>, goals_against <int>, goals_for <int>,
#> #   home_losses <int>, home_overtime_losses <int>, home_ties <int>,
#> #   home_wins <int>, last_season_id <int>, losses <int>, overtime_losses <int>,
#> #   penalty_minutes <int>, playoff_seasons <int>, point_pctg <dbl>,
#> #   points <int>, road_losses <int>, road_overtime_losses <int>, …
# }