nhl_teams_rosters: Get rosters for teams

Description Usage Arguments Value Examples

View source: R/nhl_teams.R

Description

Get rosters for teams

Usage

1
nhl_teams_rosters(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 an element called roster.roster that in itself is a data.frame with the roster data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 ## Not run: 
  # Current rosters for all teams
  nhl_teams_rosters()

  # Rosters for all teams for past seasons
  nhl_teams_rosters(seasons = c("19931994", "19931994"))

  # Roster for Devils and Islanders
  nhl_teams_rosters(
    teamIds = 1:2,
    seasons = c("19931994", "19931994")
  )

## End(Not run)

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