| calculate_distance | R Documentation |
calculate_distance() calculates the Euclidean distance from the attacking
net for all the events (plays) in a play-by-play.
calculate_distance(play_by_play)
play_by_play |
data.frame of play-by-play(s); see |
data.frame with one row per event (play) and added distance column
# May take >5s, so skip.
test <- gc_play_by_play()
test_is_home_flagged <- flag_is_home(test)
test_coords_normalized <- normalize_coordinates(test_is_home_flagged)
test_distance_calculated <- calculate_distance(test_coords_normalized)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.