nhl_standings: Retrieve metadata on NHL standings from the API

Description Usage Arguments Value Examples

View source: R/nhl_standings.R

Description

Retrieve metadata on NHL standings from the API

Usage

1
nhl_standings(seasons = NULL, standingsTypes = NULL, expand = NULL)

Arguments

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.

standingsTypes

character(), defining the standings types to retrieve. Valid standings types are for example "regularSeason" or "byDivision". See nhl_md_standings_types() for all values and their descriptions.

expand

character(), of parameters passed as expand to the API URL. A valid example seems to be "standings.record". NULL for no expand parameter.

Value

list, with information on standings depending on provided arguments.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
 # Get current standings
 nhl_standings()

 # Get standings for historical seasons
 nhl_standings(seasons = 2015:2016)

 # Get standings for historical seasons
 nhl_standings(
   seasons = 2015:2016,
   standingsType = "byDivision",
   expand = "standings.record"
 )

## End(Not run)

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