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

tm_player_injury_history pulls in no data #268

Closed
bonddr opened this issue Apr 7, 2023 · 1 comment
Closed

tm_player_injury_history pulls in no data #268

bonddr opened this issue Apr 7, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@bonddr
Copy link

bonddr commented Apr 7, 2023

I have tried to run the following: tm_player_injury_history("https://www.transfermarkt.com/manchester-city/startseite/verein/281/saison_id/2020")

I get the following error:
Error: Problem while computing injured_since = lubridate::ymd(.data[["injured_since"]]).

@JaseZiv JaseZiv self-assigned this Apr 13, 2023
@JaseZiv JaseZiv added the bug Something isn't working label Apr 13, 2023
@JaseZiv
Copy link
Owner

JaseZiv commented Apr 13, 2023

Hi there,

Thanks for raising.

This particular example you've raised isn't an issue, rather an incorrect use of the function.

You have provided a team URL to the tm_player_injury_history() function, where you need to provide a player URL(s).

This works:

# for Ederson's Injury history
player_injuries <- worldfootballR::tm_player_injury_history("https://www.transfermarkt.com/ederson/profil/spieler/238223")

# for all Man City 2020-21 players injury histories: 
players <- worldfootballR::tm_team_player_urls("https://www.transfermarkt.com/manchester-city/startseite/verein/281/saison_id/2020")
player_injuries <- worldfootballR::tm_player_injury_history(player_urls = players)

I will however keep this open as a bug as I've noticed the player_name column is also getting the player number and causing issues with output format:

image

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