Calculate individual player stats

calculate_individual(pbp, type = c("R", "P"), game_strength = "all")

Arguments

pbp

A tibble of play-by-play data, typically returned from either load_pbp or scrape_game

type

Season type to filter by; "R" for regular season and/or "P" for postseason

game_strength

String or vector of strings defining strength state to filter by; ex c("3v5","4v5","3v4") returns stats for shorthanded strength

Value

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.

player_name

String identifying player name

player_id

Integer value of the NHL player ID

team

String identifying player's most recent team

gp

Games Played

ixg

Numeric expected goals

goals

Numeric goals scored

assists

Numeric total assists

points

Numeric points scored

assists_primary

Numeric primary assists

assists_secondary

Numeric secondary assists

points_primary

Numeric primary points

m
gax

Numeric goals scored over expected

icf

Numeric shot attempts (Corsi)

iff

Numeric unblocked shot attempts (Fenwick)

isog

Numeric shots on goal

sh_perc

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:

toi

String description of total time on ice in 'minutes:seconds'

mean_toi

String description of average time on ice over all supplied games, in 'minutes:seconds'

toi_minutes

Numeric total time on ice, in minutes

mean_toi_minutes

Numeric average time on ice over all supplied games, in minutes

ixg_per60

Numeric expected goals per 60 minutes

goals_per60

Numeric goals scored per 60 minutes

assists_per60

Numeric total assists per 60 minutes

points_per60

Numeric points scored per 60 minutes

assists_primary_per60

Numeric primary assists per 60 minutes

assists_secondary_per60

Numeric secondary assists per 60 minutes

points_primary_per60

Numeric primary points per 60 minutes

gax_per60

Numeric goals scored over expected per 60 minutes

icf_per60

Numeric shot attempts (Corsi) per 60 minutes

iff_per60

Numeric unblocked shot attempts (Fenwick) per 60 minutes

isog_per60

Numeric shots on goal per 60 minutes

Examples

if (FALSE) {
#load pbp
pbp_2022 <- load_pbp(2022, shift_events = TRUE)
player_stats <- calculate_individual(pbp_2022, type = "R", game_strength = "5v5")
}