Skip to content

hkopanski/ST_558_Proj_1

Repository files navigation

Readme

ST 558 Project 1

Link to Repo Pages

Hockey data API

Description

Functions that connect to and pull data from NHL franchise records. The functions output the data into tibbles with the expection of the grab_all function, which output mutiple tibbles in the form of a named list. Data can then be used for various forms of analysis.

Usage

get_db_records(endpoint = NULL, modifier = NULL) get_db_stats(endpoint = NULL, modifier = NULL) get_goalie_data(team = NULL, ID = NULL) get_skater_data(team = NULL, ID = NULL) get_records(team = NULL, ID = NULL) get_team_stats2(team = NULL) grab_all(all = FALSE, team = NULL, ID = NULL, goalie = FALSE, skater = FALSE)

Arguments

endpoint API endpoint, such as /record-detail or /franchise.

modifier Endpoint modifier, used to parse data from API. Examples are ?cayenneExp=gameTypeId=2 or ?cayenneExp=teamFranchiseId=ID.

team String to identify team for data pull. Examples are “Coyotes”, “Boston Bruins”, or “Dallas Stars”. Not case sensitive. In the case of get_team_stats2, team can also be the franchise ID.

ID Franchise ID number for particular team. Lookup table provided in vignette.

all Argument to pull general NHL data.

team and ID Same as team and ID for previously described. Will pull in team stats when using the grab_all function.

goalie Argument to pull in team specific goalie data.

skater Argument to pull team specific skater data.

EXAMPLES

grab_all(all = TRUE, team = ‘stars’)

grab_all(team = ‘Boston Bruins’, goalie = TRUE)

grab_all(ID = 15, skater = TRUE)

About

First project for ST 558

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages