ffverse / ffpros

Retrieves data from FantasyPros.com
http://ffpros.ffverse.com
Other
9 stars 2 forks source link

fp_projections returning data frame with empty team character(0) #6

Open patstout opened 2 weeks ago

patstout commented 2 weeks ago

Describe the bug Calling fp_projections in 2024 is returning all of the expected data except 'team' is showing up as character(0)

It is also giving off a warning that seems related.

Reprex

projections <- ffpros::fp_projections( 'qb')
#> Warning: There were 79 warnings in `dplyr::mutate()`.
#> The first warning was:
#> ℹ In argument: `team = `%>%`(...)`.
#> Caused by warning in `stri_replace_all_regex()`:
#> ! argument is not an atomic vector; coercing
#> ℹ Run `dplyr::last_dplyr_warnings()` to see the 78 remaining warnings.
head( projections )
#> # A tibble: 6 × 13
#>   fantasypros_id player_name    team         passing_att passing_cmp passing_yds
#>   <chr>          <chr>          <chr>              <dbl>       <dbl>       <dbl>
#> 1 17233          Lamar Jackson  character(0)        30.4        20          232.
#> 2 22902          Jayden Daniels character(0)        31.6        22.1        235.
#> 3 19275          Jalen Hurts    character(0)        30.4        19.5        221.
#> 4 17298          Josh Allen     character(0)        30.9        19.5        216.
#> 5 19196          Joe Burrow     character(0)        35.5        24.3        266.
#> 6 18600          Kyler Murray   character(0)        31.6        21          221 
#> # ℹ 7 more variables: passing_tds <dbl>, passing_ints <dbl>, rushing_att <dbl>,
#> #   rushing_yds <dbl>, rushing_tds <dbl>, misc_fl <dbl>, misc_fpts <dbl>

Created on 2024-10-11 with reprex v2.1.1

Expected behavior The team to be available for each player.

Session information Please copy the output of sessionInfo() into the box below.

R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

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

other attached packages:
[1] reprex_2.1.1

loaded via a namespace (and not attached):
 [1] dplyr_1.1.4       compiler_4.4.1    selectr_0.4-2     crayon_1.5.3      tidyselect_1.2.1  xml2_1.3.6        stringr_1.5.1     clipr_0.8.0       assertthat_0.2.1  snakecase_0.11.1 
[11] callr_3.7.6       yaml_2.3.9        fastmap_1.2.0     R6_2.5.1          ffpros_0.1.5      generics_0.1.3    curl_5.2.1        knitr_1.48        tibble_3.2.1      janitor_2.2.0    
[21] lubridate_1.9.3   pillar_1.9.0      rlang_1.1.4       utf8_1.2.4        cachem_1.1.0      stringi_1.8.4     xfun_0.45         fs_1.6.4          timechange_0.3.0  memoise_2.0.1    
[31] cli_3.6.3         withr_3.0.0       magrittr_2.0.3    ps_1.7.7          processx_3.8.4    digest_0.6.36     rvest_1.0.4       rstudioapi_0.16.0 remotes_2.5.0     lifecycle_1.0.4  
[41] ratelimitr_0.4.1  vctrs_0.6.5       evaluate_0.24.0   glue_1.7.0        fansi_1.0.6       rmarkdown_2.27    purrr_1.0.2       httr_1.4.7        htmltools_0.5.8.1 tools_4.4.1      
[51] pkgconfig_2.0.3  
patstout commented 2 weeks ago

I think the expected white space after the team name is no longer present.

Maybe we just swap out this: stringr::str_extract_all("[A-Z]+ ")

With: stringr::str_extract_all("[A-Z]+[\s$]")

tanho63 commented 2 weeks ago

@patstout do you want to try a PR for this?