Learn R Programming

hockeyR (version 1.3.0)

calculate_toi: Calculate player time on ice

Description

A function to calculate individual skater time on ice for a provided play-by-play data set

Usage

calculate_toi(pbp)

Value

A tibble containing time on ice information for every skater in supplied pbp data

player_name

String identifying player name

player_id

Integer value of the NHL player ID

gp

Games Played

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

Arguments

pbp

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

Examples

Run this code
if (FALSE) {
pbp_2022 <- load_pbp(2022)
skater_toi <- calculate_toi(pbp_2022)
}

Run the code above in your browser using DataLab