Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBRef - Player ID - Duplicate IDs #331

Closed
kidshiva opened this issue Sep 24, 2023 · 2 comments
Closed

FBRef - Player ID - Duplicate IDs #331

kidshiva opened this issue Sep 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@kidshiva
Copy link

Hello,

Running the fb_league_stats and I am getting duplicate player IDs for players with the same name - please see screenshot below

image

championship <- fb_league_stats(
country = "ENG",
gender = "M",
season_end_year = 2024,
tier = "2nd",
non_dom_league_url = NA,
stat_type = "playing_time",
team_or_player = "player",
time_pause = 4
)

library(worldfootballR)
packageVersion("worldfootballR")
[1] ‘0.6.4.7’

@tonyelhabr
Copy link
Collaborator

Can confirm that this is a bug. It's an edge case. I'll have to think about the best way to handle it.

@tonyelhabr tonyelhabr added the bug Something isn't working label Sep 25, 2023
@tonyelhabr tonyelhabr self-assigned this Sep 25, 2023
@tonyelhabr
Copy link
Collaborator

Resolved by #332.

library(dplyr)
library(worldfootballR)
packageVersion('worldfootballR')
#> [1] '0.6.4.8'
championship <- fb_league_stats(
  country = "ENG",
  gender = "M",
  season_end_year = 2024,
  tier = "2nd",
  non_dom_league_url = NA,
  stat_type = "playing_time",
  team_or_player = "player",
  time_pause = 4
)
#> Please be aware that `fb_league_stats(..., team_or_player = "player")` depends on promises, which may not always work.
#> This message is displayed once per session.

championship |> 
  filter(Player == 'Danny Ward') |> 
  select(Rk, Player, Player_Href)
#> # A tibble: 2 × 3
#>      Rk Player     Player_Href                    
#>   <int> <chr>      <chr>                          
#> 1   623 Danny Ward /en/players/d3ce0e89/Danny-Ward
#> 2   624 Danny Ward /en/players/cfb29823/Danny-Ward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants