Closed jplecavalier closed 3 years ago
Many thanks for reporting, I will hopefully take a look into this this week!
Hi @jplecavalier, I merged the fix to master, could you possibly check whether your issue is fixed (e.g. by installing the dev version from master):
# With remotes
remotes::install_github("jozefhajnala/nhlapi")
# Or with devtools
devtools::install_github("jozefhajnala/nhlapi")
Thanks again for reporting and testing!
There is currently a problem with the
util_map_player_ids()
function when different players share the same name. I don't know yet what's the best solution to fix this, but we should at least make the error message more meaningful.The non-vectorized function
util_map_player_id()
works well.The current behaviour of
util_map_player_ids()
isI have two different proposition:
Option 1: Throw a meaningful error
Option 2: Return a list of vector with every IDs that match the name as below
However, this would break some other function using
util_map_player_ids()
, we should then address them accordingly.This time, I have three different propositions:
Option 2.1: Throw an error
Option 2.2: Default to the most recent (young) and throw a warning
Option 2.3: Return all records for the duplicate name with a warning
The same logic would apply for
nhl_players_seasons()
andnhl_players_allseasons()
.Just tell me which of the proposition you would be more comfortable with, I will take care of it and open a PR.