nhl_seasons: Retrieve metadata on NHL seasons from the API

Description Usage Arguments Value Examples

View source: R/nhl_seasons.R

Description

Retrieve metadata on NHL seasons from the API

Usage

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

data.frame, with information on seasons, one row per year.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # Get information on all seasons
  nhl_seasons()

  # Get information on 3 historical seasons
  nhl_seasons(2015:2017)

## End(Not run)

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