jimmyday12 / fitzRoy

A set of functions to easily access AFL data
https://jimmyday12.github.io/fitzRoy
Other
130 stars 27 forks source link

Missing Brownlow Votes data from 2019 #114

Closed liam-crow closed 4 months ago

liam-crow commented 4 years ago

Hey guys, love the package I ran into an error with a brownlow votes model I was running, and after a bit of digging found out that the first 3 rounds were missing the 1, 2 and 3 votes

library(dplyr)
library(fitzRoy)

afltables_2019 <- fitzRoy::get_afltables_stats(start_date = "2019-01-01")
afltables_2019 %>% group_by(as.numeric(Round), Brownlow.Votes) %>% count() %>% View()

# A tibble: 84 x 3
# Groups:   as.numeric(Round), Brownlow.Votes [84]
   `as.numeric(Round)` Brownlow.Votes     n
                 <dbl>          <dbl> <int>
 1                   1              0   396
 2                   2              0   396
 3                   3              0   396
 4                   4              0   369
 5                   4              1     9
 6                   4              2     9
 7                   4              3     9
 8                   5              0   369
 9                   5              1     9
10                   5              2     9
# ... with 74 more rows

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

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

other attached packages:
[1] fitzRoy_0.2.0 dplyr_0.8.3 

The rest of the season seems to be accurate, and so is the 2018 data. Thanks!

liam-crow commented 4 years ago

I also reran the reprex with the dev version and encountered the same problem

other attached packages:
[1] dplyr_0.8.4        fitzRoy_0.3.1.9000
peteowen1 commented 4 months ago

This seems to be fixed as at the latest version

afltables_2019 <- fitzRoy::fetch_player_stats_afltables(2019)
afltables_2019 %>% group_by(as.numeric(Round), Brownlow.Votes) %>% count() 

# A tibble: 93 × 3
# Groups:   as.numeric(Round), Brownlow.Votes [93]
   `as.numeric(Round)` Brownlow.Votes     n
                 <dbl>          <dbl> <int>
 1                   1              0   369
 2                   1              1     9
 3                   1              2     9
 4                   1              3     9
 5                   2              0   369
 6                   2              1     9
 7                   2              2     9
 8                   2              3     9
 9                   3              0   369
10                   3              1     9
# ℹ 83 more rows
# ℹ Use `print(n = ...)` to see more rows
sessionInfo()

other attached packages:
[1] fitzRoy_1.4.0 dplyr_1.1.4