
Strip the situation code into goalie and skater counts, man differential, and strength state for all the events (plays) in a play-by-play by perspective
Source:R/Clean.R
strip_situation_code.Rdstrip_situation_code() strip the situation code into goalie and skater
counts, man differential, and strength state for all the events (plays) in a
play-by-play by perspective.
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 ifflag_is_home()has already been called
Value
data.frame with one row per event (play) and added columns:
homeIsEmptyNet, awayIsEmptyNet, homeSkaterCount, awaySkaterCount,
isEmptyNetFor, isEmptyNetAgainst, skaterCountFor,
skaterCountAgainst, manDifferential, and strengthState
Examples
# May take >5s, so skip.
# \donttest{
test <- gc_play_by_play()
test_is_home_flagged <- flag_is_home(test)
test_situation_code_stripped <- strip_situation_code(test_is_home_flagged)
# }