Learn R Programming

nhlapi (version 0.1.4)

nhl_teams: Retrieve metadata on NHL teams from the API

Description

Retrieves team metadata such as the teams names, abbreviations, locations, conferences, venues, etc.

Usage

nhl_teams(teamIds = NULL, params = 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.

params

named list(), further parameters passed to nhl_url_teams.

Value

data.frame, with data on teams, one row per team.

Details

The API allows to retrieve data on all teams at once, which is achieved by the default NULL value for the team id.

Examples

Run this code
# NOT RUN {
  nhl_teams()
  nhl_teams(1:3)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab