JaseZiv / worldfootballR

A wrapper for extracting world football (soccer) data from FBref, Transfermark, Understat
https://jaseziv.github.io/worldfootballR/
455 stars 60 forks source link

`fb_match_shooting()` Home_Away column is sometimes always 'Away' #219

Closed mrmorgan17 closed 1 year ago

mrmorgan17 commented 1 year ago

When using the fb_match_shooting() function, the Home_Away is Away for both teams

Reproducible example:

EPL_2022_shooting <- fb_match_shooting(match_url = "https://fbref.com/en/matches/e62685d4/Manchester-United-Leeds-United-August-14-2021-Premier-League")

table(EPL_2022_shooting$Home_Away) returns:

Away 
  26 

When table(EPL_2022_shooting$Squad) returns:

  Leeds United Manchester Utd 
            10             16 

Although if I do:

EPL_2022_shooting <- fb_match_shooting(match_url = "https://fbref.com/en/matches/3adf2aa7/Brentford-Arsenal-August-13-2021-Premier-League")

table(EPL_2022_shooting$Home_Away) returns:

Away Home 
  22    8

When table(EPL_2022_shooting$Squad) returns:

  Arsenal Brentford 
       22         8 

This example works as expected

JaseZiv commented 1 year ago

In the example you have, Manchester United is the home team, however in the shot log table, they're Manchester Utd... have made this more robust now.

Install the latest dev version (0.6.1.8000).

Thanks for raising

mrmorgan17 commented 1 year ago

Thanks for the timely fix. Much appreciated!