nhl_url_standings: Create an NHL API URL for standings

Description Usage Arguments Value Examples

View source: R/nhl_standings.R

Description

Create an NHL API URL for standings

Usage

1
nhl_url_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

character(), vector of URLs.

Examples

1
2
3
4
5
 nhlapi:::nhl_url_standings(seasons = 2015:2016)
 nhlapi:::nhl_url_standings(
   standingsType = "byDivision",
   expand = "standings.record"
 )

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