tidy_drafts: Get a tidy dataset of NHL entry drafts

View source: R/tidy_drafts.R

tidy_draftsR Documentation

Get a tidy dataset of NHL entry drafts

Description

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

Usage

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()

# Get both the 2019 and 2020 NHL entry drafts, keeping  the IDs
tidy_drafts(drafts_year = 2019:2020, keep_id = TRUE)


jplecavalier/tidynhl documentation built on July 28, 2024, 3:48 a.m.