flag_is_rush: Flag if the shot attempt is a rush attempt or not for all the...

View source: R/Clean.R

flag_is_rushR Documentation

Flag if the shot attempt is a rush attempt or not for all the shots in a play-by-play

Description

flag_is_rush() flags if the shot attempt is a rush attempt or not for all the shots in a play-by-play.

Usage

flag_is_rush(play_by_play)

Arguments

play_by_play

data.frame of play-by-play(s); see gc_play_by_play() and/or wsc_play_by_play() for reference; must be untouched by non-nhlscraper functions; saves time if flag_is_home() and strip_time_period() had already been called

Value

data.frame with one row per event (play) and added isRush column

Examples

# May take >5s, so skip.

  test                      <- gc_play_by_play()
  test_is_home_flagged      <- flag_is_home(test)
  test_game_id_stripped     <- strip_game_id(test_is_home_flagged)
  test_time_period_stripped <- strip_time_period(test_game_id_stripped)
  test_is_rush_flagged      <- flag_is_rush(test_time_period_stripped)


nhlscraper documentation built on Dec. 17, 2025, 5:10 p.m.