NWHL Data with “sportyR” and “gganimate”

Joan Chiang
JoanChiang
Published in
1 min readMar 29, 2023

See the data and code from here Github — NWHL

The data is play-by-play tracking of 2021 National Women’s Hockey League (NWHL) events obtained from Stathletes via the 2021 Big Data Cup. I’d like to highlight the event location on the rink to demonstrate what happens during a game. I’m using the geom_hockey function from the “sportyR” package. It aids in displaying all of the rink’s details, such as the faceoff circles and goal area. Also, because the package is built within “ggplot,” I can easily combine it with other “ggplot2” variables like geom_point and geom_text. Then, for the play-by-play, I employ the “gganimate” package. The transition_state and animate functions store every plot in the series using each play as a frame.

This visualization is not a detailed investigation of the player’s or team’s performance. It displays the progress of a game through animation. A reader can see when the team scores and what they did at any given time, and we can demonstrate this type of visualization not only in ice hockey but also in other sports using the useful “gganimate” and “sportyR” packages.

--

--

Joan Chiang
JoanChiang

I am an international student, studying in sports business at Temple university. Welcome to my analytics world. I hope you'll enjoy