jimmyday12 / fitzRoy

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

get_afltables_stats returns full finals names for 2017 and 2018 seasons #45

Closed insightlane closed 5 years ago

insightlane commented 5 years ago

afltables_data_new <- get_afltables_stats(start_date = "1897-05-07", end_date = Sys.Date())

afltables_data_new %>%

A tibble: 44 x 59

Groups: Season, Round, Home.team, Away.team [1]

Season Round Date Local.start.time Venue Attendance Home.team HQ1G HQ1B HQ2G HQ2B HQ3G HQ3B HQ4G HQ4B

1 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 2 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 3 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 4 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 5 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 6 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 7 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 8 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 9 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 10 2016 GF 2016-10-01 1430 M.C.G. 99981 Western Bulld~ 2 0 7 1 9 7 13 11 # ... with 34 more rows, and 44 more variables: Home.score , Away.team , AQ1G , AQ1B , AQ2G , # AQ2B , AQ3G , AQ3B , AQ4G , AQ4B , Away.score , First.name , Surname , ID , # Jumper.No. , Playing.for , Kicks , Marks , Handballs , Goals , Behinds , # Hit.Outs , Tackles , Rebounds , Inside.50s , Clearances , Clangers , Frees.For , # Frees.Against , Brownlow.Votes , Contested.Possessions , Uncontested.Possessions , # Contested.Marks , Marks.Inside.50 , One.Percenters , Bounces , Goal.Assists , # Time.on.Ground.. , Substitute , Umpire.1 , Umpire.2 , Umpire.3 , Umpire.4 , group_id afltables_data_new %>% + filter(Season == 2017 & Round == "Grand Final") # A tibble: 44 x 59 # Groups: Season, Round, Home.team, Away.team [1] Season Round Date Local.start.time Venue Attendance Home.team HQ1G HQ1B HQ2G HQ2B HQ3G HQ3B HQ4G HQ4B 1 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 2 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 3 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 4 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 5 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 6 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 7 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 8 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 9 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 10 2017 Grand Fi~ 2017-09-30 1430 "M.C.G~ 100021 Richmond 2 3 6 4 11 8 16 12 # ... with 34 more rows, and 44 more variables: Home.score , Away.team , AQ1G , AQ1B , AQ2G , # AQ2B , AQ3G , AQ3B , AQ4G , AQ4B , Away.score , First.name , Surname , ID , # Jumper.No. , Playing.for , Kicks , Marks , Handballs , Goals , Behinds , # Hit.Outs , Tackles , Rebounds , Inside.50s , Clearances , Clangers , Frees.For , # Frees.Against , Brownlow.Votes , Contested.Possessions , Uncontested.Possessions , # Contested.Marks , Marks.Inside.50 , One.Percenters , Bounces , Goal.Assists , # Time.on.Ground.. , Substitute , Umpire.1 , Umpire.2 , Umpire.3 , Umpire.4 , group_id
jimmyday12 commented 5 years ago

Thanks mate, there are some strange parsing problems with afltables and finals. Thought I had sorted them all but will take a look!

insightlane commented 5 years ago

This one is more around the round names (e.g. 2016 uses "GF" and 2017 uses "Grand Final") etc.