Calculate individual player stats
calculate_individual(pbp, type = c("R", "P"), game_strength = "all")
A tibble of play-by-play data, typically returned from either
load_pbp
or scrape_game
Season type to filter by; "R" for regular season and/or "P" for postseason
String or vector of strings defining strength state to filter by; ex c("3v5","4v5","3v4") returns stats for shorthanded strength
A tibble containing individual shooting stats for all players in supplied pbp data. These stats are individual player stats, not player on-ice stats.
For help with on-ice stats, please see calculate_on_ice
.
String identifying player name
Integer value of the NHL player ID
String identifying player's most recent team
Games Played
Numeric expected goals
Numeric goals scored
Numeric total assists
Numeric points scored
Numeric primary assists
Numeric secondary assists
Numeric primary points
Numeric goals scored over expected
Numeric shot attempts (Corsi)
Numeric unblocked shot attempts (Fenwick)
Numeric shots on goal
Numeric shooting percentage
If supplied play-by-play data includes shift change events (the default for scrape_game
;
if using load_pbp
user must set shift_events
argument to TRUE
) then
the following rate stats will also be calculated:
String description of total time on ice in 'minutes:seconds'
String description of average time on ice over all supplied games, in 'minutes:seconds'
Numeric total time on ice, in minutes
Numeric average time on ice over all supplied games, in minutes
Numeric expected goals per 60 minutes
Numeric goals scored per 60 minutes
Numeric total assists per 60 minutes
Numeric points scored per 60 minutes
Numeric primary assists per 60 minutes
Numeric secondary assists per 60 minutes
Numeric primary points per 60 minutes
Numeric goals scored over expected per 60 minutes
Numeric shot attempts (Corsi) per 60 minutes
Numeric unblocked shot attempts (Fenwick) per 60 minutes
Numeric shots on goal per 60 minutes
if (FALSE) {
#load pbp
pbp_2022 <- load_pbp(2022, shift_events = TRUE)
player_stats <- calculate_individual(pbp_2022, type = "R", game_strength = "5v5")
}