`OHLpkg` is an R package that provides programmatic access to OHL data: player stats, goalie stats, team info, game schedules, and play-by-play events. Built for analysts, fans, and developers.
View on GitHubThe Ontario Hockey League (OHL) is one of the premier junior leagues in the world. `OHLpkg` bridges R with the OHL’s data sources, pulling JSON feeds directly from HockeyTech. This package removes the need for manual scraping, and outputs clean, ready-to-analyze data frames.
Supported data spans 1998 → 2026, including regular season, playoffs, and selected pre-season datasets.
Returns filtered skater stats (GP > 9). Now includes optional team
filter.
Returns full skater stats (no GP cutoff). Includes team filter.
Goalie stats (GP > 9). Includes team filter for v2.5.0.
Even-strength stats: calculates EVG, EVA, EVPTS, EVPTS/G, EVPTS%.
Short-handed stats, structured like EVStats but for SH goals/assists/points.
Filters draft-year eligible skaters (DY-0) based on dynamic birthdate cutoffs per season.
Filters rookie skaters (first OHL season). Team filter supported.
Returns metadata for all 20 OHL teams, or a single team if specified.
Returns league schedule and results. Supports season argument.
Play-by-play log for a specific game ID (goals, penalties, shots).
Player profile/metrics: height, weight, birthdate, position, team.
season_name
— specify "2026 Season", "2025 Playoffs", etc. Defaults to latest season.team
— filter output to a specific OHL team (v2.5.0+).game_id
— numeric ID for single game events.
# Install and load
devtools::install_github("NoahCornish/OHLpkg")
library(OHLpkg)
# Example 1: Get raw skater stats for 2026 Season
df <- get_RawStats(season_name = "2026 Season")
# Example 2: Filter by team
knights <- get_Stats("2026 Season", team = "London Knights")
# Example 3: Get goalie stats
goalies <- get_GoalieStats("2026 Season", team = "Ottawa 67's")
# Example 4: Game events
events <- get_GameEvents(game_id = 28151)
head(events)