Learn R Programming

fastRhockey

fastRhockey is an R Package that is designed to pull play-by-play (and boxscore) data from the newest version of the Premier Hockey Federation (PHF) website. In the past, there have been a few scrapers for the PHF (formerly the NWHL), but they’ve all been deprecated since the league changed website formats.

With the seventh season of the league kicking off on November 6th, and games being broadcast on ESPN+, this package was created to allow access to play-by-play data to continue pushing women’s hockey analytics forward.

In Spring of 2021, the Big Data Cup and the data they made available revolutionized what we were able to thanks to the detailed play-by-play data for the season and the x/y location data. That wave continued with the inaugural WHKYHAC conference in July that produced some amazing conversations and projects in the women’s hockey space.

In the past, the lack of data and poor access to data have been the biggest barrier to entry in women’s hockey analytics, a barrier that this package intends to alleviate.


Installation

You can install the CRAN version of fastRhockey with:

install.packages("fastRhockey")

You can install the released version of fastRhockey from GitHub with:

# You can install using the pacman package using the following code:
if (!requireNamespace('pacman', quietly = TRUE)){
  install.packages('pacman')
}
pacman::p_load_current_gh("sportsdataverse/fastRhockey", dependencies = TRUE, update = TRUE)

If you would prefer the devtools installation:

if (!requireNamespace('devtools', quietly = TRUE)){
  install.packages('devtools')
}
devtools::install_github(repo = "sportsdataverse/fastRhockey")

Documentation

You can find the documentation for fastRhockey on GitHub pages.

You can view CSVs of historical boxscore and play-by-play on the fastRhockey data repo, as well as the process for scraping that historical data.


Breaking Changes

Full News on Releases


Follow the SportsDataverse on Twitter and star this repo

Our Authors

Our Contributors (they’re awesome)

Citations

To cite the fastRhockey R package in publications, use:

BibTex Citation

@misc{howell_gilani_fastRhockey_2021,
  author = {Ben Howell and Saiem Gilani},
  title = {fastRhockey: The SportsDataverse's R Package for Hockey Data.},
  url = {https://fastRhockey.sportsdataverse.org/},
  year = {2021}
}

Copy Link

Version

Install

install.packages('fastRhockey')

Monthly Downloads

359

Version

0.4.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Saiem Gilani

Last Published

October 25th, 2022

Functions in fastRhockey (0.4.0)

load_phf_team_box

Load fastRhockey PHF team box scores
load_phf_schedule

Load fastRhockey PHF schedules
data

Data in the package for reference
most_recent_phf_season

Most Recent PHF Season
csv_from_url

Load .csv / .csv.gz file from a remote connection
fastRhockey-package

fastRhockey: Functions to Access Premier Hockey Federation and National Hockey League Play by Play Data
load_phf_pbp

Load fastRhockey PHF play-by-play
nhl_conferences

NHL Conferences
nhl_game_feed

NHL Game Feed
nhl_game_content

NHL Game Content
load_phf_player_box

Load fastRhockey PHF player box scores
load_nhl_schedule

Load fastRhockey NHL schedules
nhl_teams

NHL Teams
nhl_teams_info

NHL Teams Info
phf_game_all

PHF Game All
progressively

Progressively
rds_from_url

Load .rds file from a remote connection
nhl_divisions

NHL Divisions
nhl_player_stats

NHL Player Stats
nhl_conferences_info

NHL Conference Info
most_recent_nhl_season

Most Recent NHL Season
nhl_game_shifts

NHL Game Shifts
most_recent_nhl_season_api_param

Most Recent NHL Season for NHL API
nhl_schedule

NHL Schedule
phf_game_details

PHF Game Details
load_nhl_team_box

Load fastRhockey NHL team box scores
phf_player_stats

PHF Player Stats
nhl_draft_year

NHL Draft by Year
phf_leaders

PHF Player Leaderboards
nhl_game_boxscore

NHL Game Boxscore
phf_league_info

PHF League Information
phf_schedule

PHF Schedule
phf_standings

PHF Standings
nhl_player_info

NHL Player Info
phf_team_box

PHF Team Boxscore
phf_pbp

phf_pbp
update_nhl_db

Update or create a fastRhockey NHL play-by-play database
nhl_divisions_info

NHL Divisions Info
phf_player_box

PHF Player Boxscore
nhl_teams_roster

NHL Teams Roster
update_phf_db

Update or create a fastRhockey PHF play-by-play database
nhl_draft

NHL Draft
phf_team_roster

PHF Team Roster
nhl_teams_stats

NHL Teams Stats
phf_team_stats

PHF Team Stats
nhl_draft_prospects

NHL Draft Prospects
nhl_draft_prospects_info

NHL Draft Prospects Info
phf_game_raw

PHF Game Raw
phf_game_summary

PHF Game Summary
load_nhl_player_box

Load fastRhockey NHL player box scores
load_nhl_pbp

Load fastRhockey NHL play-by-play
espn_nhl_teams

Get ESPN NHL team names and IDs