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

[BUG] nflreadr displaying incorrect depth chart data #88

Open
2 tasks done
thedragann opened this issue Oct 13, 2024 · 1 comment
Open
2 tasks done

[BUG] nflreadr displaying incorrect depth chart data #88

thedragann opened this issue Oct 13, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@thedragann
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Have you installed the latest development version of the package(s) in question?

  • I have installed the latest development version of the package.

If this is a data issue, have you tried clearing your nflverse cache?

I have cleared my nflverse cache and the issue persists.

What version of the package do you have?

1.4.1

Describe the bug

This function is giving incorrect data. For example, George Kittle played in Weeks 1, 2, 4 and 5 yet the function is saying he played in Weeks 1, 2, 3 and 7. This coming week is Week 6, so Week 7 data shouldn't even be available yet.

Reprex

depth_charts <- load_depth_charts(
  seasons = 2024,
  file_type = getOption("nflreadr.prefer", default = "rds")
)

Expected Behavior

For example, George Kittle played in Weeks 1, 2, 4 and 5 yet the function is saying he played in Weeks 1, 2, 3 and 7. This coming week is Week 6, so Week 7 data shouldn't even be available yet.

nflverse_sitrep

> nflverse_sitrep()
── System Info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• R version 4.3.2 (2023-10-31 ucrt) • Running under: Windows 11 x64 (build 22621)
── Package Status ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
   package installed  cran        dev behind
1   nfl4th     1.0.4 1.0.4 1.0.4.9005    dev
2 nflfastR     4.6.1 4.6.1 4.6.1.9017    dev
3 nflplotR     1.4.0 1.4.0      1.4.0       
4 nflreadr     1.4.1 1.4.1   1.4.1.04    dev
5 nflseedR     1.2.0 1.2.0 1.2.0.9901    dev
6 nflverse     1.0.3 1.0.3      1.0.3       
── Package Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────
• No options set for above packages
── Package Dependencies ───────────────────────────────────────────────────────────────────────────────────────────────────────
• askpass     (1.2.0)    • htmlwidgets  (1.6.4)   • snakecase   (0.11.1)   
• backports   (1.4.1)    • httr         (1.4.7)   • stringi     (1.7.12)   
• base64enc   (0.1-3)    • isoband      (0.2.7)   • stringr     (1.5.1)    
• bigD        (0.2.0)    • janitor      (2.2.0)   • sys         (3.4.2)    
• bitops      (1.0-7)    • jquerylib    (0.1.4)   • tibble      (3.2.1)    
• bslib       (0.5.1)    • jsonlite     (1.8.7)   • tidyr       (1.3.1)    
• cachem      (1.0.8)    • juicyjuice   (0.1.0)   • tidyselect  (1.2.1)    
• cli         (3.6.1)    • knitr        (1.44)    • timechange  (0.2.0)    
• colorspace  (2.1-0)    • labeling     (0.4.3)   • tinytex     (0.46)     
• commonmark  (1.9.2)    • lifecycle    (1.0.4)   • utf8        (1.2.3)    
• cpp11       (0.4.7)    • listenv      (0.9.0)   • V8          (6.0.0)    
• crayon      (1.5.2)    • lubridate    (1.9.3)   • vctrs       (0.6.5)    
• curl        (5.2.0)    • magick       (2.8.5)   • viridisLite (0.4.2)    
• data.table  (1.14.8)   • magrittr     (2.0.3)   • withr       (3.0.0)    
• digest      (0.6.33)   • markdown     (1.13)    • xfun        (0.40)     
• dplyr       (1.1.4)    • memoise      (2.0.1)   • xgboost     (1.7.6.1)  
• evaluate    (0.21)     • mime         (0.12)    • xml2        (1.3.6)    
• fansi       (1.0.4)    • munsell      (0.5.1)   • yaml        (2.3.7)    
• farver      (2.1.2)    • openssl      (2.1.1)   • codetools   (0.2-19)   
• fastmap     (1.1.1)    • parallelly   (1.36.0)  • compiler    (4.3.2)    
• fastrmodels (1.0.2)    • pillar       (1.9.0)   • graphics    (4.3.2)    
• fontawesome (0.5.2)    • pkgconfig    (2.0.3)   • grDevices   (4.3.2)    
• fs          (1.6.4)    • progressr    (0.14.0)  • grid        (4.3.2)    
• furrr       (0.3.1)    • proto        (1.0.0)   • lattice     (0.21-9)   
• future      (1.33.1)   • purrr        (1.0.2)   • MASS        (7.3-60)   
• generics    (0.1.3)    • R6           (2.5.1)   • Matrix      (1.6-1.1)  
• ggpath      (1.0.2)    • rappdirs     (0.3.3)   • methods     (4.3.2)    
• ggplot2     (3.4.3)    • RColorBrewer (1.1-3)   • mgcv        (1.9-0)    
• globals     (0.16.2)   • Rcpp         (1.0.12)  • nlme        (3.1-163)  
• glue        (1.6.2)    • reactable    (0.4.4)   • parallel    (4.3.2)    
• gsubfn      (0.7)      • reactR       (0.6.1)   • splines     (4.3.2)    
• gt          (0.11.1)   • rlang        (1.1.1)   • stats       (4.3.2)    
• gtable      (0.3.5)    • rmarkdown    (2.25)    • tools       (4.3.2)    
• highr       (0.10)     • rstudioapi   (0.15.0)  • utils       (4.3.2)    
• hms         (1.1.3)    • sass         (0.4.9)     
• htmltools   (0.5.8.1)  • scales       (1.3.0)

Screenshots

No response

Additional context

No response

@john-b-edwards john-b-edwards transferred this issue from nflverse/nflverse-data Oct 13, 2024
@john-b-edwards
Copy link
Contributor

john-b-edwards commented Oct 13, 2024

Thanks for the flag. I went in and was able to verify that the information in the depth charts function matches what is availble in the nfl data exchange API--so the issue with the data in the API itself, not anything that we're doing.

> scrape_dc(2024,"SF","REG") |>
+     dplyr::filter(LastName == "Kittle")
  Season ClubCode Week SeasonType DepthTeam LastName FirstName FootballName Formation     GsisID JerseyNumber
1   2024       SF    1        REG         1   Kittle    George       George   Offense 00-0033288           85
2   2024       SF    2        REG         1   Kittle    George       George   Offense 00-0033288           85
3   2024       SF    3        REG         1   Kittle    George       George   Offense 00-0033288           85
4   2024       SF    7        REG         1   Kittle    George       George   Offense 00-0033288           85
  Position   EliasID DepthPosition
1       TE KIT388290            TE
2       TE KIT388290            TE
3       TE KIT388290            TE
4       TE KIT388290            TE

Consistent with how we've acted with similar issues, we are opting to provide the depth charts as is, that is, they match what is provided in the API--attempting to edit and clean the depth charts for 100% completeness and correctness is beyond the scope of anything we seek to do. I'm going to leave this issue open and tag with a wontfix.

Two quick notes:

For example, George Kittle played in Weeks 1, 2, 4 and 5 yet the function is saying he played in Weeks 1, 2, 3 and 7.

The depth charts data is not supposed to indicate whether or not someone played, just what the depth charts looked like in advance of a particular week. As I've alluded to before, there are sometimes some issues with the data. If you want to know who was on the roster for a given game, use nflreadr::load_rosters().

This coming week is Week 6, so Week 7 data shouldn't even be available yet.

The current NFL week is week 6, not the coming week--with TNF, week 6 is in progress.

It looks like the NFL provides week 7 depth charts for teams who played during TNF before Sunday and Monday's games conclude. For example, the Seahawks also have depth charts listed for week 7:

> scrape_dc(2024,"SEA","REG") |> dplyr::pull(Week) |> table()

 1  2  3  4  5  6  7 
60 60 61 60 60 61 59 

However, the Bills, who will not play until Monday, do not have a week 7 listed.

> scrape_dc(2024,"BUF","REG") |> dplyr::pull(Week) |> table()

 1  2  3  4  5  6 
58 58 59 59 58 57 

@john-b-edwards john-b-edwards added the wontfix This will not be worked on label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants