jimmyday12 / fitzRoy

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

Some player IDs have two versions of names using get_afltables_stats #47

Closed insightlane closed 5 years ago

insightlane commented 5 years ago

There are five player IDs that are coming through on get_afltables_stats with two versions of names (e.g. Patrick Ryder/Paddy Ryder):

Brief description of the problem

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

n_afltables_data %>% distinct(ID, First.name, Surname) %>% group_by(ID) %>% mutate(count_names = n()) %>% filter(count_names > 1)`

`# A tibble: 10 x 4

Groups: ID [5]

First.name Surname ID count_names

1 Patrick Ryder 4144 2 2 Matthew de Boer 11746 2 3 Jay Kennedy-Harris 12245 2 4 Darcy MacPherson 12438 2 5 Harrison Himmelberg 12462 2 6 Paddy Ryder 4144 2 7 Jay Kennedy Harris 12245 2 8 Harry Himmelberg 12462 2 9 Matt de Boer 11746 2 10 Darcy Macpherson 12438 2` ```
jimmyday12 commented 5 years ago

Hmmm thanks for digging into this. I thought I had found all of these but obviously not. I'll keep you posted

jimmyday12 commented 5 years ago

Fixed in latest commit ab2ad3c - now return the first instance of a players name even if it changes in the dataset