add_shift_times() adds SecondsRemainingInShift,
SecondsElapsedInShift, and SecondsElapsedInPeriodSinceLastShift columns
for the on-ice goalies and skaters already present in a public play-by-play.
It accepts either a single game play-by-play plus shift_chart() data or a
season aggregate plus shift_charts() data.
Arguments
- play_by_play
data.frame of play-by-play(s) using the current public schema returned by
gc_play_by_play(),gc_play_by_plays(),wsc_play_by_play(), orwsc_play_by_plays()- shift_chart
data.frame returned by
shift_chart()orshift_charts()
Value
data.frame with one row per event (play) and added or updated scalar on-ice shift timing columns
Examples
# \donttest{
pbp <- gc_play_by_play(game = 2023030417)
sc <- shift_chart(game = 2023030417)
pbp <- add_shift_times(pbp, sc)
# }