jplecavalier / tidynhl

An R package making it easy to extract NHL data in a tidy format

Home Page:https://jplecavalier.github.io/tidynhl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`tidy_players_stats()` when `players_id` have no NHL played game

stecaron opened this issue · comments

The function tidy_players_stats() outputs an error when inputs a player_id for a player that has not played any NHL game.

For a reproducible example, see the player Jared Knight (player_id = 8475743L).

Screen Shot 2021-02-01 at 8 21 00 PM

I would expect maybe an empty data.table as an output?

Thanks for reporting, this should be resolved with 942c841. Reinstall the package from GitHub and try again, you should now have the following:

library(tidynhl)
tidy_players_stats(8475743L)
##  Empty data.table (0 rows and 50 cols): player_name,season_years,season_type,team_abbreviation,skater_games,skater_goals...

I will close the issue, please reopen if needed.

Yep now it's working fine ! Thanks