JaseZiv/worldfootballR

tm_player_market_values returns wrong output

mcefis opened this issue · 3 comments

Good morning,

I notice you that the function "tm_player_market_values" has a little bit problem: infact it returns some refuses in the lines. (you can see it in bold).


For example these below are the first two rows of my output dataset:

Serie A Europe Italy 2023 SSC Napoli 1 Alex Meret Goalkeeper 1997-03-22 NA Italy NA 1.9 left 2019-07-01 Udinese Calcio 2024-06 30 1.8e+07https://www.transfermarkt.com/alex-meret/profil/spieler/240414

Serie A Europe Italy 2023 SSC Napoli 95 €18.00m Goalkeeper 1995-03-18 NA Italy NA 1.94 right 2023-01-25 Atalanta BC....

library(worldfootballR)
packageVersion("worldfootballR") #‘0.6.3.8’

a_league_valuations_ita=tm_player_market_values(country_name = "Italy",start_year = 2023)

Please, let me know, thanks and best regards

Mattia

The second column with NAs is for current club. Given you're extracting valuations for the current season, this is almost always going to be NA. If you were to get for a previous season, you would find there would be less NAs.

The firs one is for the age. I'll look in to this eventually, but given the player's date of birth is in the previous column, that can be calculated very easily.

Hello,

I also have some issues with the results of the tm_player_market_values() function. The returned results have extra rows where the player_name is filled with the price of the previous player. All the other information is like shifted and we obtain for example (see below) that Zack Steffen is a Centre-Back from Portugal playing as Man City number 3.

library(worldfootballR) # ‘0.6.4.9’
tm_player_market_values(country_name = "England", start_year = 2022)
#>
        comp_name region country season_start_year           squad player_num         player_name    player_position player_dob player_age player_nationality
1  Premier League Europe England              2022 Manchester City         31             Ederson         Goalkeeper 1993-08-17         NA             Brazil
2  Premier League Europe England              2022 Manchester City         1840.00m         Goalkeeper 1992-11-06         NA            Germany
3  Premier League Europe England              2022 Manchester City          -       Stefan Ortega         Goalkeeper 1995-04-02         NA      United States
4  Premier League Europe England              2022 Manchester City         339.00m         Goalkeeper 1985-09-03         NA            England
5  Premier League Europe England              2022 Manchester City          3        Zack Steffen        Centre-Back 1997-05-14         NA           Portugal
6  Premier League Europe England              2022 Manchester City          63.50m        Centre-Back 1995-02-18         NA        Netherlands
7  Premier League Europe England              2022 Manchester City          5        Scott Carson        Centre-Back 1994-05-28         NA            England
8  Premier League Europe England              2022 Manchester City         25200k        Centre-Back 1995-07-19         NA        Switzerland
9  Premier League Europe England              2022 Manchester City         14          Rúben Dias        Centre-Back 1994-05-27         NA              Spain
10 Premier League Europe England              2022 Manchester City          -80.00m        Centre-Back 2003-09-18         NA            England
11 Premier League Europe England              2022 Manchester City         21          Nathan Aké          Left-Back 2000-09-04         NA              Spain
12 Premier League Europe England              2022 Manchester City          -42.00m          Left-Back 2002-12-26         NA            England

This bug in the result seem a bit more severe than the previous question.

I thank you for the package and more so if you have the time to adress this issue.
Best

Hello,

I also have some issues with the results of the tm_player_market_values() function. The returned results have extra rows where the player_name is filled with the price of the previous player. All the other information is like shifted and we obtain for example (see below) that Zack Steffen is a Centre-Back from Portugal playing as Man City number 3.

library(worldfootballR) # ‘0.6.4.9’
tm_player_market_values(country_name = "England", start_year = 2022)
#>
        comp_name region country season_start_year           squad player_num         player_name    player_position player_dob player_age player_nationality
1  Premier League Europe England              2022 Manchester City         31             Ederson         Goalkeeper 1993-08-17         NA             Brazil
2  Premier League Europe England              2022 Manchester City         1840.00m         Goalkeeper 1992-11-06         NA            Germany
3  Premier League Europe England              2022 Manchester City          -       Stefan Ortega         Goalkeeper 1995-04-02         NA      United States
4  Premier League Europe England              2022 Manchester City         339.00m         Goalkeeper 1985-09-03         NA            England
5  Premier League Europe England              2022 Manchester City          3        Zack Steffen        Centre-Back 1997-05-14         NA           Portugal
6  Premier League Europe England              2022 Manchester City          63.50m        Centre-Back 1995-02-18         NA        Netherlands
7  Premier League Europe England              2022 Manchester City          5        Scott Carson        Centre-Back 1994-05-28         NA            England
8  Premier League Europe England              2022 Manchester City         25200k        Centre-Back 1995-07-19         NA        Switzerland
9  Premier League Europe England              2022 Manchester City         14          Rúben Dias        Centre-Back 1994-05-27         NA              Spain
10 Premier League Europe England              2022 Manchester City          -80.00m        Centre-Back 2003-09-18         NA            England
11 Premier League Europe England              2022 Manchester City         21          Nathan Aké          Left-Back 2000-09-04         NA              Spain
12 Premier League Europe England              2022 Manchester City          -42.00m          Left-Back 2002-12-26         NA            England

This bug in the result seem a bit more severe than the previous question.

I thank you for the package and more so if you have the time to adress this issue. Best

This one is a definite issue. I have created a separate GitHub issue here and will address asap.