nhl_teams_stats: Get team statistics per seasons

Description Usage Arguments Value Examples

View source: R/nhl_teams.R

Description

Get team statistics per seasons

Usage

1
nhl_teams_stats(teamIds = NULL, seasons = NULL)

Arguments

teamIds

integer(), ids of the teams or NULL (default) for all teams. As of end of 2019, the valid team ids seem to be in the 1:54 range.

seasons

numeric(), integer() or character(), vector of starting years of desired seasons in YYYY format, e.g. 1995 or "1995" for season 1995-1996. Accepts vectors such as c(1995:2000, 2010) to generate multiple seasons.

Alternatively, also accepts character() with seasons in the format "YYYYZZZZ", where ZZZZ = YYYY + 1, e.g. "19951996". This is the format that ultimately gets sent to the NHL API.

Some API endpoints, notably seasons exposed via nhl_seasons() also allow the value "current" to passed. This value will be returned unchanged.

Value

data.frame, with seasons statistics for the selected team(s), one row per each team and season combination.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # All teams, current seasons
  nhl_teams_stats()

  # 2 teams, 3 seasons
  nhl_teams_stats(1:2, c("20052006", "20062007", "20072008"))

## End(Not run)

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.