Get PWHL Play-By-Play Data
Introduction This document provides a function for getting the play-by-play data for a specified PWHL game. The function does not return all of the data available through the PWHL’s API, and it adds variables that are not included in the source data . You can take this function and modify it to fit your own needs. I'm updating the function as I explore this new API. If you find a glitch please let me know about it. This function does not work for game_id < 28. I have a function for those game_ids (plus some other helpful stuff) on GitHub: https://github.com/ma-barbour/pwhl Basic Setup #install.packages("tidyverse") #install.packages("jsonlite") #install.packages("httr") library (tidyverse) library (jsonlite) library (httr) Function: Get Play-By-Play Data This function gets the play-by-play data for a specified PWHL game_id. The data are pulled from the PWHL’s API. The function includes explanatory comments (accompanied by a hashtag “#”)...