nhl_url_seasons {nhlapi}R Documentation

Create an NHL API URL for seasons

Description

Create an NHL API URL for seasons

Usage

nhl_url_seasons(seasons = 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.

Value

character(), of API URLs, same length as seasons or length 1 if seasons is NULL.

Examples

  nhlapi:::nhl_url_seasons()
  nhlapi:::nhl_url_seasons(2015:2017)
  nhlapi:::nhl_url_seasons("20152016")


[Package nhlapi version 0.1.4 Index]