sportsdataverse / fastRhockey

Boxscore and play-by-play stat scraper for the Premier Hockey Federation (PHF, formerly known as the NWHL).
https://fastRhockey.sportsdataverse.org
Other
21 stars 3 forks source link

pwhl_pbp errors for certain valid game ids #45

Open TejjyGH opened 5 months ago

TejjyGH commented 5 months ago

Here is an easily reproducible example: Opening RStudio and trying to run gamedata <- fastRhockey::pwhl_pbp(10) prints the error message Error encountered: replacement has 2 rows, data has 1. Please verify the game_id and ensure it corresponds to a valid game in the PWHL.

Game data is still returned from the call, however the shape of the returned data does not match the shape of returned data from other game ids where no error is thrown.

gamedata <- fastRhockey::pwhl_pbp(11) returns 91 variables (and so does every other game id I've tested that does not give an error), whereas the previous call for game id 10 returns 93 variables.

Additionally, some game ids print a separate error message. gamedata <- fastRhockey::pwhl_pbp(45) prints the error message Error encountered: the condition has length > 1. Please verify the game_id and ensure it corresponds to a valid game in the PWHL.

These are a handful of games that throw each of the above error messages among games I've tried to retrieve data for (ids 2 - 52).