
Strip the timestamp and period number into the time elapsed in the period and game for all the events (plays) in a play-by-play
Source:R/Clean.R
strip_time_period.Rdstrip_time_period() strip the timestamp and period number into the time
elapsed in the period and game for all the events (plays) in a play-by-play.
Arguments
- play_by_play
data.frame of play-by-play(s); see
gc_play_by_play()and/orwsc_play_by_play()for reference; must be untouched by non-nhlscraper functions; saves time ifstrip_game_id()has already been called
Value
data.frame with one row per event (play) and added columns
secondsElapsedInPeriod and secondsElapsedInGame
Examples
# May take >5s, so skip.
# \donttest{
test <- gc_play_by_play()
test_game_id_stripped <- strip_game_id(test)
test_time_period_stripped <- strip_time_period(test_game_id_stripped)
# }