The function tidy_drafts() is meant to be a user-friendly way of getting data about the NHL entry drafts.

tidy_drafts(
  drafts_year = NULL,
  keep_id = FALSE,
  return_datatable = getOption("tidynhl.data.table", TRUE)
)

Arguments

drafts_year

(optional) Integer vector indicating which entry drafts will be returned. The first NHL entry draft was held in 1963. Default to NULL which will return every entry drafts in NHL history.

keep_id

(optional) Logical indicating if the IDs of different dimensions should be returned. Default to FALSE.

return_datatable

(optional) Logical indicating whether or not a data.table should be returned. Default can be set globally with options("tidynhl.data.table").

Examples

# Allowing large outputs for the pkgdown website options(width = 1000L) # Get every drafts in NHL history tidy_drafts()
#> draft_year draft_round draft_pick draft_overall team_abbreviation player_name amateur_league_name amateur_team_name #> 1: 1963 1 1 1 MTL Garry Monahan <NA> St. Michael's Juveniles #> 2: 1963 1 2 2 DET Peter Mahovlich <NA> St. Michael's Juveniles #> 3: 1963 1 3 3 BOS Orest Romashyna Jr C New Hamburg #> 4: 1963 1 4 4 NYR Al Osborne Weston Jr. B <NA> #> 5: 1963 1 5 5 CHI Art Hampson <NA> Trenton Midgets #> --- #> 11801: 2020 7 27 213 TOR Ryan Tverberg OJHL Toronto JC #> 11802: 2020 7 28 214 NYI Henrik Tikkanen FINLAND-JR. HIFK Jr. #> 11803: 2020 7 29 215 VGK Maxim Marushev RUSSIA-2 Bars Kazan #> 11804: 2020 7 30 216 BUF Jakub Konecny CZREP-JR. Sparta Jr. #> 11805: 2020 7 31 217 TBL Declan McDonnell OHL Kitchener
# Get both the 2019 and 2020 NHL entry drafts, keeping the IDs tidy_drafts(drafts_year = 2019:2020, keep_id = TRUE)
#> draft_year draft_round draft_pick draft_overall team_id team_abbreviation player_id player_name amateur_league_name amateur_team_name #> 1: 2019 1 1 1 1 NJD 8481559 Jack Hughes NTDP USA U-18 #> 2: 2019 1 2 2 3 NYR 8481554 Kaapo Kakko FINLAND TPS #> 3: 2019 1 3 3 16 CHI 8481523 Kirby Dach WHL Saskatoon #> 4: 2019 1 4 4 21 COL 8481524 Bowen Byram WHL Vancouver #> 5: 2019 1 5 5 26 LAK 8481532 Alex Turcotte NTDP USA U-18 #> --- #> 430: 2020 7 27 213 10 TOR 8482525 Ryan Tverberg OJHL Toronto JC #> 431: 2020 7 28 214 2 NYI 8482472 Henrik Tikkanen FINLAND-JR. HIFK Jr. #> 432: 2020 7 29 215 54 VGK 8482473 Maxim Marushev RUSSIA-2 Bars Kazan #> 433: 2020 7 30 216 7 BUF 8482526 Jakub Konecny CZREP-JR. Sparta Jr. #> 434: 2020 7 31 217 14 TBL 8482474 Declan McDonnell OHL Kitchener