| count_goals_shots | R Documentation |
count_goals_shots() counts the as-of-event goal, shots on goal, Fenwick,
and Corsi attempts and differentials for all the events (plays) in a
play-by-play by perspective.
count_goals_shots(play_by_play)
play_by_play |
data.frame of play-by-play(s); see |
data.frame with one row per event (play) and added columns:
homeGoals, awayGoals, homeSOG, awaySOG, homeFenwick,
awayFenwick, homeCorsi, awayCorsi, goalsFor, goalsAgainst,
SOGFor, SOGAgainst, fenwickFor, fenwickAgainst, corsiFor,
corsiAgainst, goalDifferential, SOGDifferential,
fenwickDifferential, and corsiDifferential
# May take >5s, so skip.
test <- gc_play_by_play()
test_is_home_flagged <- flag_is_home(test)
test_goals_shots_counted <- count_goals_shots(test_is_home_flagged)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.