bit in that
  • Home
  • Fantasy
    • AFL
    • Top Coaches
    • Player Selections
    • AFLW
    • Top Coaches
    • Player Selections
  • Players
    • AFL
    • Draft Prospects
    • AFLW
    • Player Data
    • Draft Prospects

AFL Draft Prospects

library(reactable)
library(arrow)
library(dplyr)
library(tidyr)
library(purrr)
library(htmltools)

combine_player_details <- read_parquet("https://github.com/bit-in-that/data-automation/raw/main/players/data/processed/combine_player_details.parquet")

# TODO: add the sources for the phantom draft orders
# TODO: add birth date and age as at 31 December 2023
# TODO: add venue to matches
# TODO: put time in local instead of AEST
# TODO: add team
phantom_draft_formatter <- function(cell_value, row_index, column_name) {
  if(cell_value == 999L) {
    ""
    } else {
      cell_value
    }
  }
Individual Profiles Down

The links to individual player profiles currently do not work due. They will be restored when some technical issues have been resolved.

Data Disclaimer

Note that data for the interstate underage competition (“AFL U18 Championships”) are missing behind and free kick data, as such these items are omitted from the calculation of fantasy points.

player_data_table <- combine_player_details |> 
  filter(gender == "male") |> 
  mutate(
    player_name = paste(player_first_name, player_surname),
    phantom_draft_afl = coalesce(phantom_draft_afl, 999L),
    phantom_draft_sporting_news = coalesce(phantom_draft_sporting_news, 999L),
    phantom_draft_fox_sports = coalesce(phantom_draft_fox_sports, 999L),
    phantom_draft_abc = coalesce(phantom_draft_abc, 999L),
    player_url = paste0("https://bitinthat.netlify.app/players/afl/underage_profiles/", playerId, ".html")
    ) |> 
  relocate(player_name, .before = "state")

player_data_table |> 
  select(-gender, -national_combine, -player_first_name, -player_surname, -playerIds, 
         -player_urls, -player_images, -player_height_range, -player_weight_range, 
         -player_height_min, -player_weight_min, -playerId) |>
  reactable(
    columns = list(
      player_name = colDef(
        name = "Player",
        sticky = "left",
        cell = function(cell_value, row_index, column_name) {
          player_url <- player_data_table[["player_url"]][[row_index]]
          player_image <- player_data_table[["player_image"]][[row_index]]
          tags$a(
            tags$img(src = player_image, style = "height: 30px;"
                     ),
            " ",
            cell_value,
            href = player_url,
            target = "_blank"
          )
        },
        width = 200
      ),
      state = colDef(name = "State"),
      state_league_club = colDef(name = "State League Club", width = 150),
      community_club = colDef(name = "Community Club", width = 150),
      date_of_birth = colDef(name = "Date of Birth"),
      player_height_max = colDef(name = "Player Height", cell = function(cell_value, row_index, column_name) {
        height <- player_data_table[["player_height_range"]][[row_index]]
        if(is.na(height)) {
          if(is.na(cell_value)) {
            ""
          } else {
            paste(cell_value, "cm")
          }
        } else {
          paste(height, "cm")
        }
        }),
      player_weight_max = colDef(name = "Player Weight", cell = function(cell_value, row_index, column_name) {
        weight <- player_data_table[["player_weight_range"]][[row_index]]
        if(is.na(weight)) {
          if(is.na(cell_value)) {
            ""
          } else {
            paste(cell_value, "kg")
          }
        } else {
          paste(weight, "kg")
        }
        }),
      player_image = colDef(show = FALSE),
      player_url = colDef(show = FALSE),
      games_played_state_underage = colDef(name = "Games"),
      fantasy_points_state_underage = colDef(name = "Fantasy Points", format = colFormat(digits = 1)),
      games_played_interstate_underage = colDef(name = "Games"),
      fantasy_points_interstate_underage = colDef(name = "Fantasy Points", format = colFormat(digits = 1)),
      games_played_state_reserves = colDef(name = "Games"),
      fantasy_points_state_reserves = colDef(name = "Fantasy Points", format = colFormat(digits = 1)),
      games_played_state_league = colDef(name = "Games"),
      fantasy_points_state_league = colDef(name = "Fantasy Points", format = colFormat(digits = 1)),
      phantom_draft_afl = colDef(name = "AFL", cell = phantom_draft_formatter),
      phantom_draft_sporting_news = colDef(name = "Sporting News", cell = phantom_draft_formatter),
      phantom_draft_fox_sports = colDef(name = "Fox Sports", cell = phantom_draft_formatter),
      phantom_draft_abc = colDef(name = "ABC", cell = phantom_draft_formatter)
    ),
    columnGroups = list(
      colGroup(name = "Player Details", columns = c("state", "state_league_club", "community_club", "date_of_birth", "player_height_max", "player_weight_max")),
      colGroup(name = "Phantom Draft Ranking", columns = c("phantom_draft_afl", "phantom_draft_sporting_news", "phantom_draft_fox_sports", "phantom_draft_abc")),
      colGroup(name = "State Underage", columns = c("games_played_state_underage", "fantasy_points_state_underage")),
      colGroup(name = "Interstate Underage", columns = c("games_played_interstate_underage", "fantasy_points_interstate_underage")),
      colGroup(name = "State Reserves", columns = c("games_played_state_reserves", "fantasy_points_state_reserves")),
      colGroup(name = "State League", columns = c("games_played_state_league", "fantasy_points_state_league"))
    ),
    filterable = TRUE
  )
​
Player Details
State Underage
Interstate Underage
State Reserves
State League
Phantom Draft Ranking
Player
State
State League Club
Community Club
Date of Birth
Player Height
Player Weight
Games
Fantasy Points
Games
Fantasy Points
Games
Fantasy Points
Games
Fantasy Points
AFL
Sporting News
Fox Sports
ABC
Aiden O'Driscoll
WA
Perth
Northam Saints
2005-07-22
172-175 cm
60-69 kg
19
60.8
4
56.5
​
​
​
​
​
​
​
​
Alex Holt
SA
Sturt
Glenunga
2005-01-28
183 cm
81 kg
17
76.2
7
59.6
12
55.7
​
​
​
​
​
​
Angus Hastie
VIC C
Geelong Falcons
Geelong West Giants
2005-09-19
187-189 cm
69 kg
22
68.6
4
43.8
​
​
​
​
​
​
​
21
Archer Reid
VIC C
Gippsland Power
Inverloch-Kongwak
2005-09-19
201-203 cm
85 kg
23
69.3
6
45.5
​
​
​
​
27
27
22
​
Archie Roberts
VIC M
Sandringham Dragons
Hampton Rovers
2005-11-18
182 cm
71-77 kg
18
66.0
4
71.8
​
​
​
​
23
22
25
27
Arie Schoenmaker
TAS
Tasmania Devils
Launceston
2005-01-07
193-194 cm
89 kg
23
73.0
2
77.0
​
​
​
​
​
26
20
​
Ashton Moir
SA
Glenelg
Plympton
2005-04-15
188 cm
84 kg
26
72.8
6
47.2
5
50.6
​
​
​
29
​
​
Bailey Van De Heuvel
VIC
Geelong Cats (VFL)
Ballarat
1998-07-31
200 cm
98 kg
​
​
​
​
​
​
31
50.1
​
​
​
​
Ben Hopkins
VIC C
Dandenong Stingrays
Langwarrin
2005-07-28
188 cm
​
14
67.1
​
​
​
​
​
​
​
​
​
​
Billy Wilson
VIC C
Dandenong Stingrays
Dromana
2005-06-16
181-182 cm
66 kg
27
58.6
4
40.0
​
​
​
​
​
​
​
​
1–10 of 116 rows
...
Back to top

2023 bit in that Source Code

 

Designed with using and Quarto