JaseZiv/worldfootballR

Error in fb_player_match_logs function: Error in httr::handle(url) : length(url) == 1 is not TRUE

Closed this issue · 5 comments

Brief description of the problem: When using the fb_player_match_logs function it throws up an error on a specific url input. I haven't tested all the players urls.

Reproducible code here:

> library(worldfootballR)
> library(tidyverse)
> packageVersion("worldfootballR")
[1] ‘0.6.2’
> 
> test <- load_fb_big5_advanced_season_stats(
+   season_end_year = 2023,
+   stat_type = "standard",
+   team_or_player = "player")
→ Data last updated 2024-02-25 17:34:59.4301750659943 UTC
> 
> # filter for player that causes error
> test2 <- filter(test, Player == "Rodrigo Ely")
> 
> fb_player_match_logs(test2$Url, 2023, stat_type= "summary", time_pause = 3)
Error in httr::handle(url) : length(url) == 1 is not TRUE
> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] lubridate_1.9.2      forcats_1.0.0        stringr_1.5.0        dplyr_1.1.2          purrr_1.0.1          readr_2.1.4          tidyr_1.3.0         
 [8] tibble_3.2.1         ggplot2_3.4.2        tidyverse_2.0.0      worldfootballR_0.6.2

loaded via a namespace (and not attached):
 [1] utf8_1.2.3        generics_0.1.3    xml2_1.3.3        stringi_1.7.12    hms_1.1.3         digest_0.6.31     magrittr_2.0.3    evaluate_0.20    
 [9] grid_4.3.0        timechange_0.2.0  fastmap_1.1.1     jsonlite_1.8.4    progress_1.2.2    httr_1.4.5        rvest_1.0.3       fansi_1.0.4      
[17] selectr_0.4-2     scales_1.2.1      cli_3.6.1         crayon_1.5.2      rlang_1.1.0       munsell_0.5.0     withr_2.5.0       yaml_2.3.7       
[25] tools_4.3.0       tzdb_0.3.0        colorspace_2.1-0  curl_5.0.0        vctrs_0.6.2       R6_2.5.1          lifecycle_1.0.3   snakecase_0.11.1 
[33] janitor_2.2.0     pkgconfig_2.0.3   pillar_1.9.0      gtable_0.3.3      glue_1.6.2        xfun_0.39         tidyselect_1.2.0  rstudioapi_0.14  
[41] knitr_1.42        htmltools_0.5.5   rmarkdown_2.21    compiler_4.3.0    prettyunits_1.1.1

Please update to the latest development version on GitHub and let me know if that fixes your issue?

I would try restarting your R session and seeing if that resolves it. Otherwise include the full code leading to this error. Thanks

I also cannot replicate this issue with the exact code.

library(worldfootballR)
packageVersion("worldfootballR")
#> [1] '0.6.5.1'
library(tidyverse)

test <- load_fb_big5_advanced_season_stats(
  season_end_year = 2023,
  stat_type = "standard",
  team_or_player = "player")
#> → Data last updated 2024-03-07 17:36:00 UTC

test2 <- filter(test, Player == "Rodrigo Ely")
fb_player_match_logs(test2$Url, 2023, stat_type= "summary", time_pause = 3)
#>         Player    Season       Date Day         Comp        Round Venue Result
#> 1  Rodrigo Ely 2022-2023 2022-08-14 Sun      La Liga  Matchweek 1  Home  L 1–2
#> ... more output

Your issues seem like they could be related to your R or RStudio setup.